github-action/README.md
Andrew Lytvynov 2075411ebb
Fail if curl gets a non-200 response code (#119)
If package or SHA download from pkgs.tailscale.com fails with a non-200
repsonse code, make the whole action fail. This catches things like
incorrect versions.

Updates #118
2024-04-23 18:20:03 -06:00

1.7 KiB

Tailscale GitHub Action

This GitHub Action connects to your Tailscale network by adding a step to your workflow.

  - 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

Subsequent steps in the Action can then access nodes in your Tailnet.

oauth-client-id and oauth-secret are an OAuth client for the tailnet to be accessed. We recommend storing these as GitHub Encrypted Secrets.

tags is a comma-separated list of one or more ACL Tags for the node. At least one tag is required: an OAuth client is not associated with any of the Users on the tailnet, it has to Tag its nodes.

Nodes created by this Action are marked as Ephemeral to be automatically removed by the coordination server a short time after they finish their run. The nodes are also marked Preapproved on tailnets which use Device Approval

Defining Tailscale version

Which Tailscale version to use can be set like this:

  - 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: 1.52.0

You can find the latest Tailscale stable version number at https://pkgs.tailscale.com/stable/#static.