Skip to content

Commit 4795ecc

Browse files
committed
Finish 0.1.3
2 parents f356c00 + 2496d56 commit 4795ecc

1 file changed

Lines changed: 21 additions & 6 deletions

File tree

.github/workflows/notify-website.yml

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff 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"

0 commit comments

Comments
 (0)