From ab65d072f4325a4d7a31609b3acbd21c5a7a7d3d Mon Sep 17 00:00:00 2001 From: Yuri Volkov <0@mcornholio.ru> Date: Mon, 30 Oct 2023 11:25: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 00000000..86980756 --- /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 }}"