Repository navigation
39 lines (39 loc) · 1.71 KB
/
Copy pathtailnet-join.yml
File metadata and controls
39 lines (39 loc) · 1.71 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# A thirty-second test of the tailnet join alone, with the same action,
# variables and tag the agent job uses, to iterate on the tailnet's
# federated credential without a full agent run.
name: tailnet-join
on:
workflow_dispatch:
inputs:
tags:
type: string
default: tag:bootc-dev-sandbox
permissions: {}
jobs:
join:
runs-on: ubuntu-26.04
permissions:
id-token: write
steps:
# Ask Tailscale directly, to see its own error text. Prints the
# response's error or, on success, only its non-secret fields.
- env:
AUDIENCE: ${{ vars.TS_AUDIENCE }}
CLIENT_ID: ${{ vars.TS_OAUTH_CLIENT_ID }}
run: |
token=$(curl -sS -H "Authorization: bearer $ACTIONS_ID_TOKEN_REQUEST_TOKEN" "$ACTIONS_ID_TOKEN_REQUEST_URL&audience=$AUDIENCE" | jq -r .value)
curl -sS -w '\nHTTP %{http_code}\n' -X POST https://api.tailscale.com/api/v2/oauth/token-exchange \
--data-urlencode "client_id=$CLIENT_ID" --data-urlencode "jwt=$token" \
| jq -R 'fromjson? // . | if type == "object" and has("access_token") then {exchange: "ok", scope, expires_in, token_type} else . end'
- uses: tailscale/github-action@064b10558093f38325e838ddea35486bdc6b1d5c # v4.4.0
with:
oauth-client-id: ${{ vars.TS_OAUTH_CLIENT_ID }}
audience: ${{ vars.TS_AUDIENCE }}
tags: ${{ inputs.tags }}
hostname: tailnet-join-${{ github.run_id }}
args: --accept-dns=false
- env:
URL: ${{ vars.INFERENCE_URL || vars.PRAXIS_BASE_URL }}
run: |
tailscale status | head -5
curl -sS -o /dev/null -w 'POST /v1/runs without a token: %{http_code}\n' -m 10 -X POST "${URL%/v1}/v1/runs"