Skip to content

Commit acedcf5

Browse files
committed
.github/workflows: add tests for new / granular minimal OAuth scopes
Change the default matrix test to use an OAuth client which has the new set of more granular minimal OAuth scopes necessary to successfully use the action. Add a new job that uses the previous OAuth client to ensure that we don't break legacy clients. Updates #184 Signed-off-by: Mario Minardi <mario@tailscale.com>
1 parent 84a3f23 commit acedcf5

1 file changed

Lines changed: 30 additions & 1 deletion

File tree

.github/workflows/tailscale.yml

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,36 @@ jobs:
1616
os: [ubuntu-latest, windows-latest, macos-latest, windows-11-arm]
1717
cache: ['false', 'true']
1818
runs-on: ${{ matrix.os }}
19+
steps:
20+
- name: Check out code
21+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
22+
23+
- name: Tailscale Action
24+
uses: ./
25+
with:
26+
oauth-client-id: ${{ secrets.TS_OAUTH_GRANULAR_CLIENT_ID }}
27+
oauth-secret: ${{ secrets.TS_OAUTH_GRANULAR_SECRET }}
28+
tags: tag:ci
29+
use-cache: ${{ matrix.cache }}
30+
31+
- name: check for tailscale connection
32+
shell: bash
33+
run:
34+
tailscale status -json | jq -r .BackendState | grep -q Running
35+
36+
- name: ensure no dirty files from Tailscale Action remain
37+
shell: bash
38+
run: |
39+
extra_files=$(git ls-files . --exclude-standard --others)
40+
if [ ! -z "$extra_files" ]; then
41+
echo "::error::Unexpected extra files: $extra_files"
42+
exit 1
43+
fi
44+
45+
# This job runs as a sanity check to ensure we have not broken the ability for OAuth clients using
46+
# our legacy scopes to successfully connect to tailnets using this action.
47+
legacyScopesCheck:
48+
runs-on: ubuntu-latest
1949
steps:
2050
- name: Check out code
2151
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
@@ -41,4 +71,3 @@ jobs:
4171
echo "::error::Unexpected extra files: $extra_files"
4272
exit 1
4373
fi
44-

0 commit comments

Comments
 (0)