File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -10,10 +10,25 @@ jobs:
1010 runs-on : ubuntu-latest
1111 steps :
1212 - name : Dispatch cli-docs-updated event to directive-website
13+ env :
14+ TOKEN : ${{ secrets.WEBSITE_DEPLOY_TOKEN }}
15+ TAG : ${{ github.ref_name }}
1316 run : |
14- curl --fail -X POST \
15- -H "Accept: application/vnd.github+json" \
16- -H "Authorization: Bearer ${{ secrets.WEBSITE_DEPLOY_TOKEN }}" \
17- -H "X-GitHub-Api-Version: 2022-11-28" \
18- https://api.github.com/repos/cceconi/directive-website/dispatches \
19- -d '{"event_type":"cli-docs-updated","client_payload":{"tag":"${{ github.ref_name }}"}}'
17+ set -euo pipefail
18+
19+ body="$(jq -nc --arg tag "$TAG" \
20+ '{event_type:"cli-docs-updated", client_payload:{tag:$tag}}')"
21+
22+ code="$(
23+ curl -sS -o resp.json -w "%{http_code}" \
24+ -H "Accept: application/vnd.github+json" \
25+ -H "Authorization: Bearer $TOKEN" \
26+ -H "X-GitHub-Api-Version: 2022-11-28" \
27+ -X POST "https://api.github.com/repos/cceconi/directive-website/dispatches" \
28+ -d "$body" || true
29+ )"
30+
31+ echo "HTTP $code"
32+ cat resp.json
33+
34+ test "$code" = "204"
You can’t perform that action at this time.
0 commit comments