From 84601fa6c2fcfd3fe17734fcf2b5edfcffd2e36b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mat=C3=ADas=20Israelson?= <57065102+israpps@users.noreply.github.com> Date: Tue, 28 Jun 2022 14:52:17 -0300 Subject: [PATCH] add payload forwarder --- .github/workflows/docker.yml | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index ff5a3f4..c0ab4d9 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -58,6 +58,18 @@ jobs: export DISPATCH_ACTION="$(echo run_build)" echo "NEW_DISPATCH_ACTION=$DISPATCH_ACTION" >> $GITHUB_ENV + - name: "create payload with this repository payload" + if: ${{ github.event_name }} != 'repository_dispatch' + run: | + export REPO_PAYLOAD="$(echo {\"ref\": \"${{ github.ref }}\", \"parent\": \"${{ github.repository }}\", \"parent_sha\": \"${{ steps.slug.outputs.sha8 }}\"})" + echo "NEW_REPO_PAYLOAD=$REPO_PAYLOAD" >> $GITHUB_ENV + + - name: "create payload with parent repository payload" + if: ${{ github.event_name }} == 'repository_dispatch' + run: | + export REPO_PAYLOAD="$(echo {\"ref\": \"${{ github.ref }}\", \"parent:\" \"${{ github.event.client_payload.parent }}\", \"parent_sha\": \"${{ github.event.client_payload.parent_sha }}\"})" + echo "NEW_REPO_PAYLOAD=$REPO_PAYLOAD" >> $GITHUB_ENV + - name: Repository Dispatch uses: peter-evans/repository-dispatch@v1 if: env.DISPATCH_TOKEN != null @@ -65,4 +77,4 @@ jobs: repository: ${{ github.repository_owner }}/ps2sdk token: ${{ secrets.DISPATCH_TOKEN }} event-type: ${{ env.NEW_DISPATCH_ACTION }} - client-payload: '{"ref": "${{ github.ref }}"}' + client-payload: '${{ env.NEW_REPO_PAYLOAD }}'