forked from payloadcms/payload
-
Notifications
You must be signed in to change notification settings - Fork 0
39 lines (34 loc) · 1.27 KB
/
dispatch-event.yml
File metadata and controls
39 lines (34 loc) · 1.27 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
38
39
name: dispatch-event
on:
workflow_dispatch:
inputs:
tag:
description: 'Release tag to process (optional)'
required: false
default: ''
env:
PAYLOAD_PUSH_MAIN_EVENT: payload-push-main-event
PAYLOAD_RELEASE_EVENT: payload-release-event
jobs:
repository-dispatch:
name: Repository dispatch
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- name: Dispatch event
if: ${{ github.event_name == 'workflow_dispatch' }}
uses: peter-evans/repository-dispatch@v3
with:
token: ${{ secrets.PAYLOAD_REPOSITORY_DISPATCH }}
repository: ${{ secrets.REMOTE_REPOSITORY }}
event-type: ${{ env.PAYLOAD_PUSH_MAIN_EVENT }}
client-payload: '{"event": {"head_commit": {"id": "${{ env.GITHUB_SHA }}"}}}' # mocked for testing
# client-payload: '{"event": ${{ toJson(github.event) }}}'
- name: Dispatch event
if: ${{ github.event_name == 'workflow_dispatch' }}
uses: peter-evans/repository-dispatch@v3
with:
token: ${{ secrets.PAYLOAD_REPOSITORY_DISPATCH }}
repository: payloadcms/website
event-type: ${{ env.PAYLOAD_RELEASE_EVENT }}
client-payload: '{"event": {"tag": "${{ github.event.inputs.tag }}"}}'