File tree Expand file tree Collapse file tree 1 file changed +39
-0
lines changed
Expand file tree Collapse file tree 1 file changed +39
-0
lines changed Original file line number Diff line number Diff line change 1+ name : CI
2+ on :
3+ push : {}
4+ pull_request_target :
5+ types : [opened, reopened, synchronize]
6+ jobs :
7+ build :
8+ name : Preview
9+ runs-on : ubuntu-22.04
10+ steps :
11+ - uses : actions/checkout@v4
12+ # SECURITY: We are checking out dnsconfig.js and creds.json from the PR.
13+ # These two files cannot perform I/O, and cannot thus be used to leak
14+ # the secret tokens.
15+ # - name: Checkout config from PR
16+ # run: |
17+ # git fetch origin +refs/pull/${{ github.event.pull_request.number }}/head
18+ # git checkout FETCH_HEAD -- dnsconfig.js
19+ - name : Generate preview
20+ id : preview
21+ run : |
22+ {
23+ echo "dnscontrol<<DNS_CONTROL_PREVIEW_OUTPUT"
24+ docker run --rm -v "$(pwd):/dns" --env CLOUDFLARE_ACCOUNT_ID --env CLOUDFLARE_API_TOKEN ghcr.io/stackexchange/dnscontrol:4.18.0 preview
25+ echo "DNS_CONTROL_PREVIEW_OUTPUT"
26+ } | tee -a $GITHUB_OUTPUT
27+ env :
28+ CLOUDFLARE_ACCOUNT_ID : ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
29+ CLOUDFLARE_API_TOKEN : ${{ secrets.CLOUDFLARE_API_TOKEN_READ_ONLY }}
30+ - name : Create comment
31+ uses : babel/actions/create-comment@v2
32+ with :
33+ token : ${{ secrets.GITHUB_TOKEN }}
34+ issue : 1
35+ comment : >
36+ Preview output:
37+ ```
38+ ${{ steps.preview.outputs.dnscontrol }}
39+ ```
You can’t perform that action at this time.
0 commit comments