-
Notifications
You must be signed in to change notification settings - Fork 5
34 lines (31 loc) · 1009 Bytes
/
dispatch-lecodex.yml
File metadata and controls
34 lines (31 loc) · 1009 Bytes
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
name: Trigger lecodex rebuild
on:
push:
branches: [main]
workflow_dispatch:
concurrency:
group: dispatch-lecodex
cancel-in-progress: true
jobs:
dispatch:
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: POST repository_dispatch to gl0bal01/lecodex
env:
DISPATCH_TOKEN: ${{ secrets.LECODEX_DISPATCH_TOKEN }}
run: |
set -euo pipefail
: "${GITHUB_SHA:?}"
: "${GITHUB_REF:?}"
payload=$(jq -nc \
--arg sha "$GITHUB_SHA" \
--arg ref "$GITHUB_REF" \
'{event_type:"vault-updated", client_payload:{sha:$sha, ref:$ref}}')
curl -fsSL -X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer $DISPATCH_TOKEN" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/gl0bal01/lecodex/dispatches \
-d "$payload"
echo "Dispatched lecodex rebuild for $GITHUB_SHA"