mirror of
https://github.com/tailscale/github-action.git
synced 2026-08-20 02:39:22 +00:00
miscellaneous cleanup items from upgrading to TypeScript action
Updates tailscale/corp#32821 Signed-off-by: Percy Wegmann <percy@tailscale.com>
This commit is contained in:
parent
392b48279b
commit
d4729ea54c
10 changed files with 73 additions and 78 deletions
22
.github/workflows/lint.yml
vendored
22
.github/workflows/lint.yml
vendored
|
|
@ -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)
|
||||
echo "" && exit 1)
|
||||
|
|
|
|||
25
.github/workflows/smoke-test.yml
vendored
25
.github/workflows/smoke-test.yml
vendored
|
|
@ -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
|
||||
|
||||
|
||||
|
||||
8
.github/workflows/test.yml
vendored
8
.github/workflows/test.yml
vendored
|
|
@ -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
|
||||
|
|
|
|||
72
README.md
72
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"
|
||||
```
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
`tag:ci` must have access to the `lax-pve` server.
|
||||
|
|
|
|||
|
|
@ -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'
|
||||
|
||||
|
|
|
|||
2
dist/index.js
vendored
2
dist/index.js
vendored
|
|
@ -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") || "",
|
||||
|
|
|
|||
12
package.json
12
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",
|
||||
|
|
|
|||
|
|
@ -243,7 +243,7 @@ async function getInputs(): Promise<TailscaleConfig> {
|
|||
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") || "",
|
||||
|
|
|
|||
|
|
@ -60,4 +60,4 @@
|
|||
// "emitDecoratorMetadata": true, /* Enables experimental support for emitting type metadata for decorators. */
|
||||
},
|
||||
"exclude": ["node_modules", "**/*.test.ts"]
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue