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 : Downstream Notifier
2+
3+ on :
4+ release :
5+ types :
6+ - published
7+
8+ jobs :
9+ notify :
10+ name : Notify Downstream
11+ runs-on : ubuntu-latest
12+ steps :
13+ - name : Dispatch downstream repository
14+ env :
15+ DISPATCH_REPO : f5gov/nginx-webssh2
16+ DOWNSTREAM_TOKEN : ${{ secrets.DOWNSTREAM_TOKEN }}
17+ RELEASE_TAG : ${{ github.event.release.tag_name }}
18+ run : |
19+ set -euo pipefail
20+ if [ -z "${DOWNSTREAM_TOKEN:-}" ]; then
21+ echo 'DOWNSTREAM_TOKEN secret is not configured' >&2
22+ exit 1
23+ fi
24+
25+ payload=$(jq -n --arg version "${RELEASE_TAG}" '{event_type:"webssh2-release", client_payload:{version:$version}}')
26+
27+ response=$(curl --fail-with-body \
28+ -X POST \
29+ -H "Accept: application/vnd.github+json" \
30+ -H "Authorization: Bearer ${DOWNSTREAM_TOKEN}" \
31+ -H "X-GitHub-Api-Version: 2022-11-28" \
32+ https://api.github.com/repos/${DISPATCH_REPO}/dispatches \
33+ -d "${payload}" 2>&1)
34+
35+ if [ -n "${response}" ]; then
36+ echo "Dispatch response: ${response}"
37+ fi
38+
39+ echo "Dispatched webssh2-release to ${DISPATCH_REPO} for tag ${RELEASE_TAG}"
You can’t perform that action at this time.
0 commit comments