Skip to content

Commit 37445f5

Browse files
farcallerwillnorris
authored andcommitted
Add support for using oauth
Follows up on the oauth support in tailscale/tailscale#7393.
1 parent b579b2f commit 37445f5

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

action.yml

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,13 @@ inputs:
66
required: true
77
api-key:
88
description: "Tailscale API key"
9-
required: true
9+
required: false
10+
oauth-client-id:
11+
description: "Tailscale OAuth ID"
12+
required: false
13+
oauth-secret:
14+
description: "Tailscale OAuth Secret"
15+
required: false
1016
policy-file:
1117
description: "Path to policy file"
1218
required: true
@@ -18,21 +24,23 @@ runs:
1824
using: "composite"
1925
steps:
2026
- name: Check Auth Info Empty
21-
if: ${{ inputs.api-key == '' }}
27+
if: ${{ inputs['api-key'] == '' && inputs['oauth-secret'] == '' }}
2228
shell: bash
2329
run: |
24-
echo "::error title=⛔ error hint::API Key empty. Maybe you need to populate it in the Secrets for your workflow, see more in https://docs.github.com/en/actions/security-guides/encrypted-secrets"
30+
echo "::error title=⛔ error hint::API Key or OAuth secret must be specified. Maybe you need to populate it in the Secrets for your workflow, see more in https://docs.github.com/en/actions/security-guides/encrypted-secrets and https://tailscale.com/s/oauth-clients"
2531
exit 1
2632
- uses: actions/setup-go@v4.0.0
2733
with:
2834
go-version: 1.21.6
2935
- shell: bash
3036
env:
3137
GOBIN: /usr/local/bin/
32-
run: go install tailscale.com/cmd/gitops-pusher@gitops-1.30.0
38+
run: go install tailscale.com/cmd/gitops-pusher@gitops-1.58.2
3339

3440
- shell: bash
3541
env:
3642
TS_API_KEY: "${{ inputs.api-key }}"
43+
TS_OAUTH_ID: "${{ inputs.oauth-client-id }}"
44+
TS_OAUTH_SECRET: "${{ inputs.oauth-secret }}"
3745
TS_TAILNET: "${{ inputs.tailnet }}"
3846
run: gitops-pusher "--policy-file=${{ inputs.policy-file }}" "${{ inputs.action }}"

0 commit comments

Comments
 (0)