diff --git a/README.md b/README.md index 6d69900..b7ee7c9 100644 --- a/README.md +++ b/README.md @@ -63,5 +63,17 @@ Which Tailscale version to use can be set like this: 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@v2 + 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 https://pkgs.tailscale.com/stable/#static. diff --git a/action.yml b/action.yml index 1bcfe73..338da15 100644 --- a/action.yml +++ b/action.yml @@ -21,7 +21,7 @@ inputs: description: 'Comma separated list of Tags to be applied to nodes. The OAuth client must have permission to apply these tags.' required: false version: - description: 'Tailscale version to use.' + description: 'Tailscale version to use. Specify `latest` to use the latest stable version.' required: true default: '1.72.1' sha256sum: @@ -70,6 +70,10 @@ runs: VERSION: ${{ inputs.version }} SHA256SUM: ${{ inputs.sha256sum }} run: | + if [ "$VERSION" = "latest" ]; then + VERSION=$(curl -s "https://pkgs.tailscale.com/stable/?mode=json" | jq -r .Version) + echo "Latest Tailscale version: $VERSION" + fi if [ ${{ runner.arch }} = "ARM64" ]; then TS_ARCH="arm64" elif [ ${{ runner.arch }} = "ARM" ]; then