No description
Find a file
Sam Linville 265da64f6f
{action.yml,.github}: add oidc workload identity federation flow to github action186 from samlinville/main
{action.yml,.github}: add oidc workload identity federation flow to github action
2025-08-12 09:16:36 -04:00
.github/workflows Resolve merge conflict with tailscale/github-action 2025-07-31 21:02:45 -04:00
action.yml Update action.yml 2025-08-12 09:16:12 -04:00
LICENSE create deployable GitHub action 2021-04-23 18:20:24 -04:00
README.md add oidc workload identity federation flow to github action 2025-07-31 18:26:50 -04:00

Tailscale GitHub Action

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

  - name: Tailscale
    uses: tailscale/github-action@v3
    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. OAuth clients used for this purpose must have the auth_keys scope.

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

Authenticate with GitHub's OIDC provider (alpha)

The Tailscale GitHub action can use an OIDC token provided by GitHub to authenticate the workflow to your tailnet. This functionality is currently available as a private alpha. To join the alpha program, contact your account rep or email sam@tailscale.com.

  - name: Tailscale
    uses: tailscale/github-action@v3
    with:
      oidc-client-id: ${{ secrets.TS_OIDC_CLIENT_ID }}
      oidc-aud-claim: ${{ secrets.TS_OIDC_AUD_CLAIM }}
      tags: tag:ci

Tailnet Lock

If you are using this Action in a Tailnet Lock enabled network, you need to:

  • Authenticate using an ephemeral reusable pre-signed auth key rather than an OAuth client.
  • Specify a state directory for the client to store the Tailnet Key Authority data in.
  - name: Tailscale
    uses: tailscale/github-action@v3
    with:
      authkey: tskey-auth-...
      statedir: /tmp/tailscale-state/

Defining Tailscale version

Which Tailscale version to use can be set like this:

  - name: Tailscale
    uses: tailscale/github-action@v3
    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

  - name: Tailscale
    uses: tailscale/github-action@v3
    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.

Cache Tailscale binaries

Caching can reduce download times and download failures on runners with slower network connectivity. Although caching is not enabled by default, it is generally recommended.

You can opt in to caching Tailscale binaries by passing 'true' to the use-cache input:

  - name: Tailscale
    uses: tailscale/github-action@v3
    with:
      oauth-client-id: ${{ secrets.TS_OAUTH_CLIENT_ID }}
      oauth-secret: ${{ secrets.TS_OAUTH_SECRET }}
      use-cache: 'true'