Skip to content

Commit

Permalink
Added RFC cron job (#68)
Browse files Browse the repository at this point in the history
Added RFC Cron job which will iterate over existing referendas and post
a link to them in the open Pull Requests.

This resolves #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.
  • Loading branch information
Bullrich authored Jan 24, 2024
1 parent 785a318 commit fbab2fb
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions .github/workflows/rfc-referenda-notifications.yml
Original file line number Diff line number Diff line change
@@ -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/[email protected]
env:
GH_TOKEN: ${{ github.token }}
PROVIDER_URL: "wss://polkadot-collectives-rpc.polkadot.io"
START_DATE: ${{ steps.date.outputs.last }}

0 comments on commit fbab2fb

Please sign in to comment.