From 08cef1ebfd3b76bdaa872fa6b679f70997d3423a Mon Sep 17 00:00:00 2001 From: Yuri Volkov <0@mcornholio.ru> Date: Wed, 1 Nov 2023 13:14:18 +0100 Subject: [PATCH] Adding gitspiegel-trigger workflow Using a workflow to trigger mirroring instead of a webhook allows us to reuse "Approving workflow runs from public forks" GitHub feature to somewhat protect us from malicious PRs --- .github/workflows/gitspiegel-trigger.yml | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 .github/workflows/gitspiegel-trigger.yml diff --git a/.github/workflows/gitspiegel-trigger.yml b/.github/workflows/gitspiegel-trigger.yml new file mode 100644 index 0000000..8698075 --- /dev/null +++ b/.github/workflows/gitspiegel-trigger.yml @@ -0,0 +1,20 @@ +name: gitspiegel sync + +on: + pull_request: + types: + - opened + - synchronize + - unlocked + - ready_for_review + - reopened + +jobs: + sync: + runs-on: ubuntu-latest + steps: + - name: Trigger sync via API + run: | + curl --fail-with-body -XPOST "https://gitspiegel.parity-prod.parity.io/api/v1/mirror/${{ github.repository }}/pull/${{ github.event.number }}" \ + -H "Content-Type: application/json" \ + -H "x-auth: ${{ secrets.GITSPIEGEL_TOKEN }}"