-
Notifications
You must be signed in to change notification settings - Fork 12
37 lines (33 loc) · 1.06 KB
/
Copy pathrequest.yml
File metadata and controls
37 lines (33 loc) · 1.06 KB
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
35
36
37
name: request
on:
workflow_run:
workflows:
- check
types:
- completed
permissions:
contents: read
jobs:
request:
if: >-
github.event.workflow_run.conclusion == 'success' &&
github.event.workflow_run.event == 'push' &&
github.event.workflow_run.head_branch == 'main'
runs-on: ubuntu-latest
env:
REQUEST_REPOSITORY: ${{ secrets.REQUEST_REPOSITORY }}
REQUEST_TOKEN: ${{ secrets.REQUEST_TOKEN }}
steps:
- name: Request site deployment
run: |
if [ -z "$REQUEST_REPOSITORY" ] || [ -z "$REQUEST_TOKEN" ]; then
echo "REQUEST_REPOSITORY and REQUEST_TOKEN are required." >&2
exit 1
fi
curl --fail-with-body \
--request POST \
--header "Accept: application/vnd.github+json" \
--header "Authorization: Bearer $REQUEST_TOKEN" \
--header "X-GitHub-Api-Version: 2022-11-28" \
"https://api.github.com/repos/$REQUEST_REPOSITORY/dispatches" \
--data '{"event_type":"publication-updated"}'