Commit graph

40 commits

Author SHA1 Message Date
TowyTowy
0e42fa1ff3 fix: reuse stale tailscale.tgz on self-hosted runners
On persistent self-hosted runners the XDG cache directory survives between
jobs. When GitHub's Actions cache backend doesn't return a hit (no working
backend, evicted entry, etc.), the tailscale.tgz left behind by a previous
job is still on disk, and tc.downloadTool() refuses to overwrite an existing
destination, failing with "Destination file path ... already exists".

Mirror the Windows MSI fix (#259): if the tarball already exists, reuse it
when its checksum matches, otherwise delete and re-download. Only the
cloud-cache-restore path previously avoided this collision, so the Linux
download was unconditional.

Fixes #294

Signed-off-by: TowyTowy <towy@airreps.link>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-09 14:36:37 -06:00
Lee Briggs
5a0d794b30
extract logging function into its own class
Signed-off-by: Lee Briggs <lee@leebriggs.co.uk>
2026-07-02 18:47:15 -07:00
Lee Briggs
ba16990ca0
catch errors
Signed-off-by: Lee Briggs <lee@leebriggs.co.uk>
2026-07-02 18:39:04 -07:00
Lee Briggs
191eb01caf
build
Signed-off-by: Lee Briggs <lee@leebriggs.co.uk>
2026-07-02 17:04:08 -07:00
Lee Briggs
73c8a00bae
feat: implement log grouping for better output
Signed-off-by: Lee Briggs <lee@leebriggs.co.uk>
2026-07-02 16:40:48 -07:00
Alex Chan
a36a368140 action: download the correct binary on riscv64
Updates #299

Signed-off-by: Alex Chan <alexc@tailscale.com>
2026-06-29 14:27:57 +01:00
maxcleme
bf966a7aba fix: typo glone -> clone
Was it on purpose? 😅

Signed-off-by: maxcleme <maxime.clement@docker.com>
2026-04-16 11:11:24 -06:00
dependabot[bot]
306e68a486 Bump @actions/cache from 5.0.1 to 5.0.2
Bumps [@actions/cache](https://github.com/actions/toolkit/tree/HEAD/packages/cache) from 5.0.1 to 5.0.2.
- [Changelog](https://github.com/actions/toolkit/blob/main/packages/cache/RELEASES.md)
- [Commits](https://github.com/actions/toolkit/commits/HEAD/packages/cache)

---
updated-dependencies:
- dependency-name: "@actions/cache"
  dependency-version: 5.0.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: Mario Minardi <mario@tailscale.com>
2026-03-11 12:54:23 -06:00
dependabot[bot]
989d9be101 Bump @actions/tool-cache from 2.0.2 to 3.0.0
Bumps [@actions/tool-cache](https://github.com/actions/toolkit/tree/HEAD/packages/tool-cache) from 2.0.2 to 3.0.0.
- [Changelog](https://github.com/actions/toolkit/blob/main/packages/tool-cache/RELEASES.md)
- [Commits](https://github.com/actions/toolkit/commits/HEAD/packages/tool-cache)

---
updated-dependencies:
- dependency-name: "@actions/tool-cache"
  dependency-version: 3.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-03-11 12:48:58 -06:00
dependabot[bot]
cda17d523f Bump @actions/core from 2.0.1 to 2.0.2
Bumps [@actions/core](https://github.com/actions/toolkit/tree/HEAD/packages/core) from 2.0.1 to 2.0.2.
- [Changelog](https://github.com/actions/toolkit/blob/main/packages/core/RELEASES.md)
- [Commits](https://github.com/actions/toolkit/commits/HEAD/packages/core)

---
updated-dependencies:
- dependency-name: "@actions/core"
  dependency-version: 2.0.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: Mario Minardi <mario@tailscale.com>
2026-03-11 12:07:56 -06:00
Mario Minardi
48c6d0317a action,dist,src: bump default version to 1.94.2
Bump default version used by the action to 1.94.2. This will resolve
warnings in the admin console about known security vulnerabilities in
the previous default of 1.90.4 which aren't applicable for the GitHub
action.

The security vulnerabilities are specifically related to MDM policies
for MacOS (see https://tailscale.com/security-bulletins#ts-2026-001) and
related to using Tailnet lock without passing `--statedir` or `--state`
to tailscaled (see https://tailscale.com/security-bulletins#ts-2025-008).

Neither of these impact the GitHub action as MacOS runners aren't
managed by MDM policies and we pass either `--statedir` or `--state` to
the tailscale daemon.

Fixes https://github.com/tailscale/github-action/issues/272

Signed-off-by: Mario Minardi <mario@tailscale.com>
2026-03-11 12:00:14 -06:00
fbrv
cfed5b8999 store tailscale.tgz and tailscaled.pid in XDG cache/runtime dirs instead of the working directory 2026-03-11 11:55:28 -06:00
Lukas Mracek
564fe381c8 chore: run make build to resolve linter error 2026-02-25 16:50:39 -07:00
Dorin Geman
9c1802ce6b fix: Windows MSI download on self-hosted runners
On self-hosted runners, the tool cache directory persists between runs.
When GitHub's cloud cache doesn't have an entry (first run, evicted, etc.), but the local MSI file exists from a previous run, tc.downloadTool() fails with "Destination file path already exists".

This fix checks if the existing MSI has a valid checksum before downloading:
- If valid: reuse it (skip download)
- If invalid: delete and re-download

Signed-off-by: Dorin Geman <dorin.geman@docker.com>
2026-01-15 16:39:13 -07:00
dependabot[bot]
53acf82332 Bump @actions/core from 2.0.0 to 2.0.1
Bumps [@actions/core](https://github.com/actions/toolkit/tree/HEAD/packages/core) from 2.0.0 to 2.0.1.
- [Changelog](https://github.com/actions/toolkit/blob/main/packages/core/RELEASES.md)
- [Commits](https://github.com/actions/toolkit/commits/@actions/artifact@2.0.1/packages/core)

---
updated-dependencies:
- dependency-name: "@actions/core"
  dependency-version: 2.0.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-12-23 08:52:08 -07:00
dependabot[bot]
376b8a186d Bump @actions/exec from 1.1.1 to 2.0.0
Bumps [@actions/exec](https://github.com/actions/toolkit/tree/HEAD/packages/exec) from 1.1.1 to 2.0.0.
- [Changelog](https://github.com/actions/toolkit/blob/main/packages/exec/RELEASES.md)
- [Commits](https://github.com/actions/toolkit/commits/HEAD/packages/exec)

---
updated-dependencies:
- dependency-name: "@actions/exec"
  dependency-version: 2.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-12-23 08:46:03 -07:00
dependabot[bot]
6b3a1307e5 Bump @actions/cache from 4.1.0 to 5.0.1
Bumps [@actions/cache](https://github.com/actions/toolkit/tree/HEAD/packages/cache) from 4.1.0 to 5.0.1.
- [Changelog](https://github.com/actions/toolkit/blob/main/packages/cache/RELEASES.md)
- [Commits](https://github.com/actions/toolkit/commits/HEAD/packages/cache)

---
updated-dependencies:
- dependency-name: "@actions/cache"
  dependency-version: 5.0.1
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-12-23 08:38:59 -07:00
dependabot[bot]
afff14da14 Bump semver from 6.3.1 to 7.7.3
Bumps [semver](https://github.com/npm/node-semver) from 6.3.1 to 7.7.3.
- [Release notes](https://github.com/npm/node-semver/releases)
- [Changelog](https://github.com/npm/node-semver/blob/main/CHANGELOG.md)
- [Commits](https://github.com/npm/node-semver/compare/v6.3.1...v7.7.3)

---
updated-dependencies:
- dependency-name: semver
  dependency-version: 7.7.3
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-12-15 12:52:06 -07:00
dependabot[bot]
e8244c1283 Bump @actions/core from 1.11.1 to 2.0.0
Bumps [@actions/core](https://github.com/actions/toolkit/tree/HEAD/packages/core) from 1.11.1 to 2.0.0.
- [Changelog](https://github.com/actions/toolkit/blob/main/packages/core/RELEASES.md)
- [Commits](https://github.com/actions/toolkit/commits/HEAD/packages/core)

---
updated-dependencies:
- dependency-name: "@actions/core"
  dependency-version: 2.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-12-15 08:43:18 -07:00
Mario Minardi
67f81e554b dist: run make build to generated updated index.js
Running make build was missed on #235 and subsequently missed by me
when reviewing that PR (whoops).

Updates #cleanup

Signed-off-by: Mario Minardi <mario@tailscale.com>
2025-12-11 11:09:57 -07:00
Mario Minardi
ef403f0d06
action.yml,src: add support for workload identity federation
Add support for workload identity federation based authentication.

Updates https://github.com/tailscale/corp/issues/31264

Signed-off-by: Mario Minardi <mario@tailscale.com>
2025-10-29 07:51:52 -06:00
Mario Minardi
bf5cb7c4d7
src: check against platform specific versions for latest and unstable
Check against platform and package specific version numbers returned
from pkgs.tailscale.com instead of defaulting to "Version" as this can
be incorrect for certain platforms when a release has only been built
for a subset of platforms.

For example. 1.90.2 is available for linux at the time of writing so
"Version" is 1.90.2, but only 1.90.1 is available for windows which
causes an error when using latest as the version specifier on windows
machines.

Fixes https://github.com/tailscale/github-action/issues/219

Signed-off-by: Mario Minardi <mario@tailscale.com>
2025-10-26 18:34:14 -06:00
Percy Wegmann
3a217367ca validate that when using an OAuth client, tags are specified
Also include a troubleshooting section in the README with information about the
requested tags are invalid or not permitted error.

Updates #78

Signed-off-by: Percy Wegmann <percy@tailscale.com>
2025-10-20 14:38:46 -05:00
Percy Wegmann
2ddbe90864 stop tailscale service after CI workload finishes
Updates #205

Signed-off-by: Percy Wegmann <percy@tailscale.com>
2025-10-20 12:53:03 -05:00
Percy Wegmann
aa604318b6 run all commands silently
To avoid leaking any potentially sensitive information, all commands are now run
without logging to the console. Logging can be enabled by turning on debug logging
as described at https://docs.github.com/en/actions/how-tos/monitor-workflows/enable-debug-logging.

Updates tailscale/corp#33405

Signed-off-by: Percy Wegmann <percy@tailscale.com>
2025-10-15 14:31:02 -05:00
Lee Briggs
0edb496506
mask secrets
Signed-off-by: Lee Briggs <lee@leebriggs.co.uk>
2025-10-15 14:59:05 -04:00
Percy Wegmann
ac425ca194 stop echoing tailscale status to console
Updates #201

Signed-off-by: Percy Wegmann <percy@tailscale.com>
2025-10-14 16:46:07 -05:00
Percy Wegmann
2976a889fc miscellaneous cleanup items from upgrading to TypeScript action
Updates tailscale/corp#32821

Signed-off-by: Percy Wegmann <percy@tailscale.com>
2025-10-14 13:12:31 -05:00
Percy Wegmann
2c45c8a0fd configure DNS on macOS runners
On macOS, `tailscaled` does not manage DNS. Configure it manually in the GitHub action to make
sure MagicDNS name resolution works.

Updates tailscale/corp#32821

Signed-off-by: Percy Wegmann <percy@tailscale.com>
2025-10-14 13:12:31 -05:00
Percy Wegmann
d4729ea54c miscellaneous cleanup items from upgrading to TypeScript action
Updates tailscale/corp#32821

Signed-off-by: Percy Wegmann <percy@tailscale.com>
2025-10-14 13:12:31 -05:00
Percy Wegmann
392b48279b fix bugs in ping logic, ping hosts in parallel, and tweak README and LICENSE
The ping logic had some bugs in the wait logic which are now fixed.

Pinging hosts in parallel will speed up CI.

LICENSE and README got small updates in preparation for moving this code
to tailscale/github-action.

Updates tailscale/corp#32862

Signed-off-by: Percy Wegmann <percy@tailscale.com>
2025-10-14 13:12:31 -05:00
Percy Wegmann
d2d502c92b update documentation and LICENSE to match existing github-action and document new features
Documented new features:

- Logout functionality
- Ping functionality

Also removed speed-comparison CI flow in preparation for replacing the official GitHub
action with this one.

Updates tailscale/corp#32820

Signed-off-by: Percy Wegmann <percy@tailscale.com>
2025-10-14 13:12:31 -05:00
Percy Wegmann
cff51cdb0c stop pinging hosts as soon as any connectivity is available
Even if we just have DERP connectivity, stop pinging so that action can continue sooner.

Updates tailscale/corp#32862

Signed-off-by: Percy Wegmann <percy@tailscale.com>
2025-10-14 13:12:31 -05:00
Percy Wegmann
fc77efa75d adjust action parameters based on original tailscale/github-action
`oauth-client-secret` is renamed to `oauth-secret` to match the original action.

Not all of the descriptions matched exactly, but this attempts to take the best from both versions.

Default Tailscale version is updated to 1.88.3.

Updates tailscale/corp#32814

Signed-off-by: Percy Wegmann <percy@tailscale.com>
2025-10-14 13:12:31 -05:00
Percy Wegmann
75aaac9f12 add support for testing peer connectivity
The new argument `ping` allows users to specify a comma-seperated list
of hosts (IP or hostname) to ping in order to verify connectivity.
Ping is considered successful as soon as the peer is reachable either
directly or via DERP.

Updates tailscale/corp#32817

Signed-off-by: Percy Wegmann <percy@tailscale.com>
2025-10-14 13:12:31 -05:00
Percy Wegmann
90629cdeb4 factor out commonly repeated constants
Updates tailscale/corp#31655

Signed-off-by: Percy Wegmann <percy@tailscale.com>
2025-10-14 13:12:31 -05:00
Percy Wegmann
cf94bd9cf6 support "unstable" version option on all platforms except macOS
The tailscale repo does not get tagged for unstable builds, so the best we can do when
building macOS from source is to build from the HEAD of `main`.

Updates tailscale/corp#32813

Signed-off-by: Percy Wegmann <percy@tailscale.com>
2025-10-14 13:12:31 -05:00
Percy Wegmann
39ac0a5882 add dependency on prettier and apply autoformatting
Updates tailscale/corp#30483

Signed-off-by: Percy Wegmann <percy@tailscale.com>
2025-10-14 13:12:31 -05:00
Percy Wegmann
391d5e0792 get tests running in new repo
- Use secrets from the new repo
- Build MacOS from source

Updates tailscale/corp#31655

Signed-off-by: Percy Wegmann <percy@tailscale.com>
2025-10-14 13:12:31 -05:00
Lee Briggs
ece0596be3 initial commit
Signed-off-by: Lee Briggs <lee@leebriggs.co.uk>
Signed-off-by: Percy Wegmann <percy@tailscale.com>
2025-10-14 13:12:31 -05:00