Skip to content

Commit d4729ea

Browse files
committed
miscellaneous cleanup items from upgrading to TypeScript action
Updates tailscale/corp#32821 Signed-off-by: Percy Wegmann <[email protected]>
1 parent 392b482 commit d4729ea

File tree

10 files changed

+73
-78
lines changed

10 files changed

+73
-78
lines changed

.github/workflows/lint.yml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,25 +8,25 @@ on:
88
- main
99

1010
jobs:
11-
# Basic smoke test that doesn't require secrets
11+
# Basic linter check
1212
lint-check:
13-
name: Smoke Test (${{ matrix.os }})
14-
13+
name: Lint check
14+
1515
runs-on: ubuntu-latest
1616

1717
steps:
1818
- name: Checkout
19-
uses: actions/checkout@v4
20-
19+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
20+
2121
- name: Setup Node.js
22-
uses: actions/setup-node@v4
22+
uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0
2323
with:
24-
node-version: '20'
25-
cache: 'npm'
26-
24+
node-version: "24"
25+
cache: "npm"
26+
2727
- name: Install Dependencies
2828
run: npm ci
29-
29+
3030
- name: Run formatter check
3131
run: |
3232
./node_modules/.bin/prettier --check --loglevel silent "src/**/*.ts" || ( \
@@ -41,4 +41,4 @@ jobs:
4141
echo "dist is out of date, run this command on your local device to fix the error:" && \
4242
echo "" && \
4343
echo " make build" && \
44-
echo "" && exit 1)
44+
echo "" && exit 1)

.github/workflows/smoke-test.yml

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -14,29 +14,29 @@ jobs:
1414
strategy:
1515
matrix:
1616
os: [ubuntu-latest, windows-latest, macos-latest]
17-
17+
1818
runs-on: ${{ matrix.os }}
19-
19+
2020
steps:
2121
- name: Checkout
22-
uses: actions/checkout@v4
23-
22+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
23+
2424
- name: Setup Node.js
25-
uses: actions/setup-node@v4
25+
uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0
2626
with:
27-
node-version: '20'
28-
cache: 'npm'
29-
27+
node-version: "24"
28+
cache: "npm"
29+
3030
- name: Install Dependencies
3131
run: npm ci
32-
32+
3333
- name: Build Action
3434
run: npm run build
35-
35+
3636
- name: Test Action Loading (No Auth)
3737
uses: ./
3838
with:
39-
version: "1.82.0"
39+
version: "latest"
4040
continue-on-error: true
4141
id: smoke-test
4242

@@ -50,6 +50,3 @@ jobs:
5050
else
5151
echo "✅ Action correctly failed without authentication as expected"
5252
fi
53-
54-
55-

.github/workflows/test.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ jobs:
3333
- os: ubuntu-latest
3434
runner-os: Linux
3535
arch: amd64
36-
version: 1.82.0
36+
# leave version blank to fall back to default
3737

3838
# Linux tests (ARM64)
3939
- os: ubuntu-24.04-arm
@@ -76,12 +76,12 @@ jobs:
7676

7777
steps:
7878
- name: Checkout
79-
uses: actions/checkout@v4
79+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
8080

8181
- name: Setup Node.js
82-
uses: actions/setup-node@v4
82+
uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0
8383
with:
84-
node-version: "20"
84+
node-version: "24"
8585
cache: "npm"
8686

8787
- name: Install Dependencies

README.md

Lines changed: 35 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@ This GitHub Action connects to your [Tailscale network](https://tailscale.com)
44
by adding a step to your workflow.
55

66
```yaml
7-
- name: Tailscale
8-
uses: tailscale/github-action@v4
9-
with:
10-
oauth-client-id: ${{ secrets.TS_OAUTH_CLIENT_ID }}
11-
oauth-secret: ${{ secrets.TS_OAUTH_SECRET }}
12-
tags: tag:ci
7+
- name: Tailscale
8+
uses: tailscale/github-action@v4
9+
with:
10+
oauth-client-id: ${{ secrets.TS_OAUTH_CLIENT_ID }}
11+
oauth-secret: ${{ secrets.TS_OAUTH_SECRET }}
12+
tags: tag:ci
1313
```
1414
1515
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
3232
## Eventual consistency
3333

3434
Propagating information about new peers - such as the node created by this action - across your tailnet
35-
is an eventually consistent process, and brief delays are expected. Until the GitHub workflow node
36-
becomes visible, other peers will not accept connections. It is best to verify connectivity to the
35+
is an eventually consistent process, and brief delays are expected. Until the GitHub workflow node
36+
becomes visible, other peers will not accept connections. It is best to verify connectivity to the
3737
intended nodes before executing steps that rely on them.
3838

3939
You can do this by adding a list of hosts to ping to the action configuration:
@@ -60,45 +60,43 @@ The `ping` option will wait up to to 3 minutes for a connection (direct or relay
6060
If you are using this Action in a [Tailnet
6161
Lock](https://tailscale.com/kb/1226/tailnet-lock) enabled network, you need to:
6262

63-
* Authenticate using an ephemeral reusable [pre-signed auth key](
64-
https://tailscale.com/kb/1226/tailnet-lock#add-a-node-using-a-pre-signed-auth-key)
63+
- 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)
6564
rather than an OAuth client.
66-
* Specify a [state directory](
67-
https://tailscale.com/kb/1278/tailscaled#flags-to-tailscaled) for the
65+
- Specify a [state directory](https://tailscale.com/kb/1278/tailscaled#flags-to-tailscaled) for the
6866
client to store the Tailnet Key Authority data in.
6967

7068
```yaml
71-
- name: Tailscale
72-
uses: tailscale/github-action@v4
73-
with:
74-
authkey: tskey-auth-...
75-
statedir: /tmp/tailscale-state/
69+
- name: Tailscale
70+
uses: tailscale/github-action@v4
71+
with:
72+
authkey: tskey-auth-...
73+
statedir: /tmp/tailscale-state/
7674
```
7775

7876
## Defining Tailscale version
7977

8078
Which Tailscale version to use can be set like this:
8179

8280
```yaml
83-
- name: Tailscale
84-
uses: tailscale/github-action@v4
85-
with:
86-
oauth-client-id: ${{ secrets.TS_OAUTH_CLIENT_ID }}
87-
oauth-secret: ${{ secrets.TS_OAUTH_SECRET }}
88-
tags: tag:ci
89-
version: 1.52.0
81+
- name: Tailscale
82+
uses: tailscale/github-action@v4
83+
with:
84+
oauth-client-id: ${{ secrets.TS_OAUTH_CLIENT_ID }}
85+
oauth-secret: ${{ secrets.TS_OAUTH_SECRET }}
86+
tags: tag:ci
87+
version: 1.52.0
9088
```
9189

9290
If you'd like to specify the latest version, simply set the version as `latest`
9391

9492
```yaml
95-
- name: Tailscale
96-
uses: tailscale/github-action@v4
97-
with:
98-
oauth-client-id: ${{ secrets.TS_OAUTH_CLIENT_ID }}
99-
oauth-secret: ${{ secrets.TS_OAUTH_SECRET }}
100-
tags: tag:ci
101-
version: latest
93+
- name: Tailscale
94+
uses: tailscale/github-action@v4
95+
with:
96+
oauth-client-id: ${{ secrets.TS_OAUTH_CLIENT_ID }}
97+
oauth-secret: ${{ secrets.TS_OAUTH_SECRET }}
98+
tags: tag:ci
99+
version: latest
102100
```
103101

104102
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.
116114
Although caching is generally recommended, you can disable it by passing `'false'` to the `use-cache` input:
117115

118116
```yaml
119-
- name: Tailscale
120-
uses: tailscale/github-action@v4
121-
with:
122-
oauth-client-id: ${{ secrets.TS_OAUTH_CLIENT_ID }}
123-
oauth-secret: ${{ secrets.TS_OAUTH_SECRET }}
124-
use-cache: 'false'
117+
- name: Tailscale
118+
uses: tailscale/github-action@v4
119+
with:
120+
oauth-client-id: ${{ secrets.TS_OAUTH_CLIENT_ID }}
121+
oauth-secret: ${{ secrets.TS_OAUTH_SECRET }}
122+
use-cache: "false"
125123
```

README_CI.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22

33
CI tests run against the pineapplefish-tailnet.org.github tailnet. Check our usual credential store for credentials.
44

5-
`tag:ci` must have access to the `lax-pve` server.
5+
`tag:ci` must have access to the `lax-pve` server.

action.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Copyright (c) Lee Briggs, Tailscale Inc, & Contributors
22
# SPDX-License-Identifier: BSD-3-Clause
33

4-
name: 'Action Setup Tailscale'
4+
name: 'Connect Tailscale'
55
description: 'Connect your GitHub Action workflow to Tailscale'
66
branding:
77
icon: 'arrow-right-circle'
@@ -63,7 +63,7 @@ inputs:
6363
default: ''
6464

6565
runs:
66-
using: 'node20'
66+
using: 'node24'
6767
main: 'dist/index.js'
6868
post: 'dist/logout/index.js'
6969

dist/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41307,7 +41307,7 @@ async function getInputs() {
4130741307
let ping = core.getInput("ping");
4130841308
let pingHosts = ping?.length > 0 ? ping.split(",") : [];
4130941309
return {
41310-
version: core.getInput("version") || "1.82.0",
41310+
version: core.getInput("version") || "1.88.3",
4131141311
resolvedVersion: "",
4131241312
arch: "",
4131341313
authKey: core.getInput("authkey") || "",

package.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
{
2-
"name": "action-tailscale",
3-
"version": "0.0.1",
4-
"description": "Install Tailscale and connect to a tailnet",
2+
"name": "github-action",
3+
"version": "4.0.0",
4+
"description": "Connect your GitHub Action workflow to Tailscale",
55
"main": "dist/main.js",
66
"scripts": {
77
"build": "ncc build src/main.ts -o dist && ncc build src/logout/logout.ts -o dist/logout"
88
},
99
"repository": {
1010
"type": "git",
11-
"url": "git+https://github.com/jaxxstorm/action-setup-tailscale"
11+
"url": "git+https://github.com/tailscale/github-action"
1212
},
13-
"author": "Lee Briggs",
14-
"license": "Apache-2.0",
13+
"author": "Lee Briggs, Tailscale Inc, & Contributors",
14+
"license": "BSD-3-Clause",
1515
"dependencies": {
1616
"@actions/cache": "^4.0.0",
1717
"@actions/core": "^1.10.1",

src/main.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ async function getInputs(): Promise<TailscaleConfig> {
243243
let pingHosts = ping?.length > 0 ? ping.split(",") : [];
244244

245245
return {
246-
version: core.getInput("version") || "1.82.0",
246+
version: core.getInput("version") || "1.88.3",
247247
resolvedVersion: "",
248248
arch: "",
249249
authKey: core.getInput("authkey") || "",

tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,4 +60,4 @@
6060
// "emitDecoratorMetadata": true, /* Enables experimental support for emitting type metadata for decorators. */
6161
},
6262
"exclude": ["node_modules", "**/*.test.ts"]
63-
}
63+
}

0 commit comments

Comments
 (0)