From d4729ea54ca9d5f5d12f8a619183eb4107eec114 Mon Sep 17 00:00:00 2001 From: Percy Wegmann Date: Wed, 1 Oct 2025 13:32:39 -0500 Subject: [PATCH] miscellaneous cleanup items from upgrading to TypeScript action Updates tailscale/corp#32821 Signed-off-by: Percy Wegmann --- .github/workflows/lint.yml | 22 +++++----- .github/workflows/smoke-test.yml | 25 +++++------ .github/workflows/test.yml | 8 ++-- README.md | 72 ++++++++++++++++---------------- README_CI.md | 2 +- action.yml | 4 +- dist/index.js | 2 +- package.json | 12 +++--- src/main.ts | 2 +- tsconfig.json | 2 +- 10 files changed, 73 insertions(+), 78 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 8bfe973..ae2ddb3 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -8,25 +8,25 @@ on: - main jobs: - # Basic smoke test that doesn't require secrets + # Basic linter check lint-check: - name: Smoke Test (${{ matrix.os }}) - + name: Lint check + runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v4 - + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + - name: Setup Node.js - uses: actions/setup-node@v4 + uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0 with: - node-version: '20' - cache: 'npm' - + node-version: "24" + cache: "npm" + - name: Install Dependencies run: npm ci - + - name: Run formatter check run: | ./node_modules/.bin/prettier --check --loglevel silent "src/**/*.ts" || ( \ @@ -41,4 +41,4 @@ jobs: echo "dist is out of date, run this command on your local device to fix the error:" && \ echo "" && \ echo " make build" && \ - echo "" && exit 1) \ No newline at end of file + echo "" && exit 1) diff --git a/.github/workflows/smoke-test.yml b/.github/workflows/smoke-test.yml index 552860c..525d8f5 100644 --- a/.github/workflows/smoke-test.yml +++ b/.github/workflows/smoke-test.yml @@ -14,29 +14,29 @@ jobs: strategy: matrix: os: [ubuntu-latest, windows-latest, macos-latest] - + runs-on: ${{ matrix.os }} - + steps: - name: Checkout - uses: actions/checkout@v4 - + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + - name: Setup Node.js - uses: actions/setup-node@v4 + uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0 with: - node-version: '20' - cache: 'npm' - + node-version: "24" + cache: "npm" + - name: Install Dependencies run: npm ci - + - name: Build Action run: npm run build - + - name: Test Action Loading (No Auth) uses: ./ with: - version: "1.82.0" + version: "latest" continue-on-error: true id: smoke-test @@ -50,6 +50,3 @@ jobs: else echo "✅ Action correctly failed without authentication as expected" fi - - - \ No newline at end of file diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 4ebfd58..e501717 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -33,7 +33,7 @@ jobs: - os: ubuntu-latest runner-os: Linux arch: amd64 - version: 1.82.0 + # leave version blank to fall back to default # Linux tests (ARM64) - os: ubuntu-24.04-arm @@ -76,12 +76,12 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - name: Setup Node.js - uses: actions/setup-node@v4 + uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0 with: - node-version: "20" + node-version: "24" cache: "npm" - name: Install Dependencies diff --git a/README.md b/README.md index cbbfd28..dfdec20 100644 --- a/README.md +++ b/README.md @@ -4,12 +4,12 @@ This GitHub Action connects to your [Tailscale network](https://tailscale.com) by adding a step to your workflow. ```yaml - - name: Tailscale - uses: tailscale/github-action@v4 - with: - oauth-client-id: ${{ secrets.TS_OAUTH_CLIENT_ID }} - oauth-secret: ${{ secrets.TS_OAUTH_SECRET }} - tags: tag:ci +- name: Tailscale + uses: tailscale/github-action@v4 + with: + oauth-client-id: ${{ secrets.TS_OAUTH_CLIENT_ID }} + oauth-secret: ${{ secrets.TS_OAUTH_SECRET }} + tags: tag:ci ``` Subsequent steps in the Action can then access nodes in your Tailnet. @@ -32,8 +32,8 @@ on tailnets which use [Device Approval](https://tailscale.com/kb/1099/device-app ## Eventual consistency Propagating information about new peers - such as the node created by this action - across your tailnet -is an eventually consistent process, and brief delays are expected. Until the GitHub workflow node -becomes visible, other peers will not accept connections. It is best to verify connectivity to the +is an eventually consistent process, and brief delays are expected. Until the GitHub workflow node +becomes visible, other peers will not accept connections. It is best to verify connectivity to the intended nodes before executing steps that rely on them. You can do this by adding a list of hosts to ping to the action configuration: @@ -60,19 +60,17 @@ The `ping` option will wait up to to 3 minutes for a connection (direct or relay If you are using this Action in a [Tailnet Lock](https://tailscale.com/kb/1226/tailnet-lock) enabled network, you need to: -* Authenticate using an ephemeral reusable [pre-signed auth key]( - https://tailscale.com/kb/1226/tailnet-lock#add-a-node-using-a-pre-signed-auth-key) +- Authenticate using an ephemeral reusable [pre-signed auth key](https://tailscale.com/kb/1226/tailnet-lock#add-a-node-using-a-pre-signed-auth-key) rather than an OAuth client. -* Specify a [state directory]( - https://tailscale.com/kb/1278/tailscaled#flags-to-tailscaled) for the +- Specify a [state directory](https://tailscale.com/kb/1278/tailscaled#flags-to-tailscaled) for the client to store the Tailnet Key Authority data in. ```yaml - - name: Tailscale - uses: tailscale/github-action@v4 - with: - authkey: tskey-auth-... - statedir: /tmp/tailscale-state/ +- name: Tailscale + uses: tailscale/github-action@v4 + with: + authkey: tskey-auth-... + statedir: /tmp/tailscale-state/ ``` ## Defining Tailscale version @@ -80,25 +78,25 @@ Lock](https://tailscale.com/kb/1226/tailnet-lock) enabled network, you need to: Which Tailscale version to use can be set like this: ```yaml - - name: Tailscale - uses: tailscale/github-action@v4 - with: - oauth-client-id: ${{ secrets.TS_OAUTH_CLIENT_ID }} - oauth-secret: ${{ secrets.TS_OAUTH_SECRET }} - tags: tag:ci - version: 1.52.0 +- name: Tailscale + uses: tailscale/github-action@v4 + with: + oauth-client-id: ${{ secrets.TS_OAUTH_CLIENT_ID }} + oauth-secret: ${{ secrets.TS_OAUTH_SECRET }} + tags: tag:ci + version: 1.52.0 ``` If you'd like to specify the latest version, simply set the version as `latest` ```yaml - - name: Tailscale - uses: tailscale/github-action@v4 - with: - oauth-client-id: ${{ secrets.TS_OAUTH_CLIENT_ID }} - oauth-secret: ${{ secrets.TS_OAUTH_SECRET }} - tags: tag:ci - version: latest +- name: Tailscale + uses: tailscale/github-action@v4 + with: + oauth-client-id: ${{ secrets.TS_OAUTH_CLIENT_ID }} + oauth-secret: ${{ secrets.TS_OAUTH_SECRET }} + tags: tag:ci + version: latest ``` You can find the latest Tailscale stable version number at @@ -116,10 +114,10 @@ As of v4 of this action, caching is enabled by default. Although caching is generally recommended, you can disable it by passing `'false'` to the `use-cache` input: ```yaml - - name: Tailscale - uses: tailscale/github-action@v4 - with: - oauth-client-id: ${{ secrets.TS_OAUTH_CLIENT_ID }} - oauth-secret: ${{ secrets.TS_OAUTH_SECRET }} - use-cache: 'false' +- name: Tailscale + uses: tailscale/github-action@v4 + with: + oauth-client-id: ${{ secrets.TS_OAUTH_CLIENT_ID }} + oauth-secret: ${{ secrets.TS_OAUTH_SECRET }} + use-cache: "false" ``` diff --git a/README_CI.md b/README_CI.md index 756751a..84d09ca 100644 --- a/README_CI.md +++ b/README_CI.md @@ -2,4 +2,4 @@ CI tests run against the pineapplefish-tailnet.org.github tailnet. Check our usual credential store for credentials. -`tag:ci` must have access to the `lax-pve` server. \ No newline at end of file +`tag:ci` must have access to the `lax-pve` server. diff --git a/action.yml b/action.yml index a0ab75e..eb4d5b2 100644 --- a/action.yml +++ b/action.yml @@ -1,7 +1,7 @@ # Copyright (c) Lee Briggs, Tailscale Inc, & Contributors # SPDX-License-Identifier: BSD-3-Clause -name: 'Action Setup Tailscale' +name: 'Connect Tailscale' description: 'Connect your GitHub Action workflow to Tailscale' branding: icon: 'arrow-right-circle' @@ -63,7 +63,7 @@ inputs: default: '' runs: - using: 'node20' + using: 'node24' main: 'dist/index.js' post: 'dist/logout/index.js' diff --git a/dist/index.js b/dist/index.js index 0d1483e..bfdcd63 100644 --- a/dist/index.js +++ b/dist/index.js @@ -41307,7 +41307,7 @@ async function getInputs() { let ping = core.getInput("ping"); let pingHosts = ping?.length > 0 ? ping.split(",") : []; return { - version: core.getInput("version") || "1.82.0", + version: core.getInput("version") || "1.88.3", resolvedVersion: "", arch: "", authKey: core.getInput("authkey") || "", diff --git a/package.json b/package.json index 3bd63e7..12d4d77 100644 --- a/package.json +++ b/package.json @@ -1,17 +1,17 @@ { - "name": "action-tailscale", - "version": "0.0.1", - "description": "Install Tailscale and connect to a tailnet", + "name": "github-action", + "version": "4.0.0", + "description": "Connect your GitHub Action workflow to Tailscale", "main": "dist/main.js", "scripts": { "build": "ncc build src/main.ts -o dist && ncc build src/logout/logout.ts -o dist/logout" }, "repository": { "type": "git", - "url": "git+https://github.com/jaxxstorm/action-setup-tailscale" + "url": "git+https://github.com/tailscale/github-action" }, - "author": "Lee Briggs", - "license": "Apache-2.0", + "author": "Lee Briggs, Tailscale Inc, & Contributors", + "license": "BSD-3-Clause", "dependencies": { "@actions/cache": "^4.0.0", "@actions/core": "^1.10.1", diff --git a/src/main.ts b/src/main.ts index ebce791..0b7988e 100644 --- a/src/main.ts +++ b/src/main.ts @@ -243,7 +243,7 @@ async function getInputs(): Promise { let pingHosts = ping?.length > 0 ? ping.split(",") : []; return { - version: core.getInput("version") || "1.82.0", + version: core.getInput("version") || "1.88.3", resolvedVersion: "", arch: "", authKey: core.getInput("authkey") || "", diff --git a/tsconfig.json b/tsconfig.json index a7ca5f1..ca4ac69 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -60,4 +60,4 @@ // "emitDecoratorMetadata": true, /* Enables experimental support for emitting type metadata for decorators. */ }, "exclude": ["node_modules", "**/*.test.ts"] -} \ No newline at end of file +}