Cannot run action on Act
I would like to use act: https://github.com/nektos/act to test my actions.
However, at the tailscale step I got :
failed to connect to local tailscaled; it doesn't appear to be running (sudo systemctl start tailscaled ?)
It should no matter but on the machine running act I also have tailscale configured and running.
Here is the github flow :
name: Pull request
on:
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
branches:
- main
jobs:
preview-deployment:
if: github.event.pull_request.draft == false
name: preview-deployment
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version-file: package.json
- name: Install Dependencies
run: npm install
- name: Tailscale
uses: tailscale/github-action@main
with:
oauth-client-id: ${{ secrets.TS_OAUTH_CLIENT_ID }}
oauth-secret: ${{ secrets.TS_OAUTH_SECRET }}
tags: tag:MySuperTag
- uses: pulumi/actions@v5
with:
command: preview
stack-name: dev
env:
PULUMI_ACCESS_TOKEN: ${{ secrets.PULUMI_ACCESS_TOKEN }}
Thanks in advance ! :) Have a great day
I'm also experiencing this but not on ACT, on action runner on kubernetes self hosted.
Same problem
A workaround I found that allows me to run Tailscale using nektos/act is the following:
- Add
nohupto the tailscaled startup; this prevents the daemon from exiting, which I'm guessing happens if systemctl is not available; See https://github.com/Pikachews/tailscale-action/commit/72b6eb8850d8a3fa0c7ed8ca897b5aa877ba7bfe - Enable userspace networking, because
/dev/net/tunis not present on some(?) containers; see https://tailscale.com/kb/1112/userspace-networking. See https://github.com/Pikachews/tailscale-action/commit/83244b4e48caeeb6d6346e50b794a11f7e920fc9 - Use either the MagicDNS domain (e.g.
machine-name.tailnet-name.ts.net) or the machine's Tailscale IP to connect to the machine, because/etc/resolve.confwon't be updated to be able to resolve the machine name.
This allowed me to successfully connect to other machines on the tailnet.
I've incorporated 1 and 2 into https://github.com/Pikachews/tailscale-action so that it is a drop-in replacement for this action.