diff --git a/.github/workflows/repostiory_dispatch.yaml b/.github/workflows/repostiory_dispatch.yaml new file mode 100644 index 00000000..f2c2d9fd --- /dev/null +++ b/.github/workflows/repostiory_dispatch.yaml @@ -0,0 +1,28 @@ +name: Dispatch to Forked Repository + +on: + push: + branches-ignore: + - '.*\/ignore-action$' + +jobs: + print: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v2 + - name: Get the refs + run: echo "[log] ref is ${{github.ref}}" + - name: Get the branch name + run: echo "[log] Branch name is ${{github.ref_name}}" + + dispatch: + runs-on: ubuntu-latest + steps: + - name: Repository Dispatch + run: | + curl -L \ + -X POST https://api.github.com/repos/${{vars.DEPLOY_REPO_PATH}}/dispatches \ + -H "Accept: application/vnd.github+json" \ + -H "Authorization: Bearer ${{ secrets.DEPLOY_REPO_ACCESS_TOKEN}}" \ + -d '{"event_type": "sync", "client_payload": {"target_branch": "${{github.ref_name}}"}}'