From fbab2fbd221df1c9fb3308e8a8ce6abcab988860 Mon Sep 17 00:00:00 2001 From: Javier Bullrich Date: Wed, 24 Jan 2024 22:41:39 +0100 Subject: [PATCH] Added RFC cron job (#68) Added RFC Cron job which will iterate over existing referendas and post a link to them in the open Pull Requests. This resolves polkadot-fellows/RFCs#57 Every time it iterates, it looks for referendas that have been submitted _after_ the time of the last run, to stop itself from posting duplicated comments. It is set to run every day at 12, and it can also be triggered manually. --- .../workflows/rfc-referenda-notifications.yml | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 .github/workflows/rfc-referenda-notifications.yml diff --git a/.github/workflows/rfc-referenda-notifications.yml b/.github/workflows/rfc-referenda-notifications.yml new file mode 100644 index 000000000..b56b73099 --- /dev/null +++ b/.github/workflows/rfc-referenda-notifications.yml @@ -0,0 +1,25 @@ +name: RFC Cron + +on: + workflow_dispatch: + schedule: + - cron: '* 11 * * *' + +jobs: + test_run: + runs-on: ubuntu-latest + steps: + - name: Get last run + run: | + last=$(gh run list -w "$WORKFLOW" --json startedAt,status -q 'map(select(.status == "completed"))[0].startedAt') + echo "last=$last" >> "$GITHUB_OUTPUT" + id: date + env: + GH_TOKEN: ${{ github.token }} + WORKFLOW: ${{ github.workflow }} + GH_REPO: "${{ github.repository_owner }}/${{ github.event.repository.name }}" + - uses: paritytech/rfc-action@v0.0.7 + env: + GH_TOKEN: ${{ github.token }} + PROVIDER_URL: "wss://polkadot-collectives-rpc.polkadot.io" + START_DATE: ${{ steps.date.outputs.last }}