-
Notifications
You must be signed in to change notification settings - Fork 4
/
combine-and-push-acls.yaml.example
54 lines (47 loc) · 1.53 KB
/
combine-and-push-acls.yaml.example
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
name: push-acls
on:
pull_request:
branches: [ "main" ]
push:
branches: [ "main" ]
env:
ACL_PARENT_FILE: "testdata/input-parent.hujson"
ACL_CHILD_DIR: "testdata/departments"
ACL_SECTIONS_ALLOWED: "acls,extraDNSRecords,grants,groups,ssh,tests"
jobs:
acls:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: '>=1.22.0'
- name: install tailscale-acl-combiner
run: |
go install github.com/tailscale-dev/tailscale-acl-combiner@latest
- name: generate file and compare to committed file
run: |
tailscale-acl-combiner \
-f $ACL_PARENT_FILE \
-d $ACL_CHILD_DIR \
-allow $ACL_SECTIONS_ALLOWED \
-o $RUNNER_TEMP/generated-by-pull-request.hujson
diff -c policy.hujson $RUNNER_TEMP/generated-by-pull-request.hujson
- name: Test ACL
if: github.event_name == 'pull_request'
id: test-acl
uses: tailscale/gitops-acl-action@v1
with:
tailnet: ${{ vars.TS_TAILNET }}
oauth-client-id: ${{ vars.TS_OAUTH_ID }}
oauth-secret: ${{ secrets.TS_OAUTH_SECRET }}
action: test
- name: Deploy ACL
if: github.event_name == 'push'
id: deploy-acl
uses: tailscale/gitops-acl-action@v1
with:
tailnet: ${{ vars.TS_TAILNET }}
oauth-client-id: ${{ vars.TS_OAUTH_ID }}
oauth-secret: ${{ secrets.TS_OAUTH_SECRET }}
action: apply