diff --git a/.github/workflows/dispatch-event.yml b/.github/workflows/dispatch-event.yml new file mode 100644 index 0000000000..4509b2408b --- /dev/null +++ b/.github/workflows/dispatch-event.yml @@ -0,0 +1,22 @@ +name: dispatch-event + +on: + workflow_dispatch: + +env: + PAYLOAD_PUSH_MAIN_EVENT: payload-push-main-event + +jobs: + repository-dispatch: + name: Repository dispatch + runs-on: ubuntu-latest + steps: + - 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) }}}'