Random Beacon Contribution #68
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Random Beacon Contribution | |
on: | |
issues: | |
types: [opened, closed] | |
jobs: | |
open_issue: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out repository | |
uses: actions/checkout@v4 | |
- name: Get total issue count | |
id: get_issue_count | |
run: | | |
ISSUE_COUNT=$(gh api -X GET repos/${{ github.repository }}/issues?state=all --jq 'length') | |
echo "issue_count=$ISSUE_COUNT" >> $GITHUB_ENV | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Check if milestone is reached | |
id: check_milestone | |
run: | | |
if [ $(( ${{ env.issue_count }} % 10 )) -eq 0 ]; then | |
echo "milestone=true" >> $GITHUB_ENV | |
else | |
echo "milestone=false" >> $GITHUB_ENV | |
fi | |
shell: bash | |
- name: Create new Random Beacon issue if milestone reached | |
if: env.milestone == 'true' | |
run: | | |
gh api -X POST repos/${{ github.repository }}/issues -f title='Random Beacon Contribution' -f body="This is an automated issue created to collect random beacons. A [verifiable contribution](ceremony.mdhttps://github.com/zircuit-labs/ceremony/blob/main/docs/ceremony.md#publicly-verifiable-source-of-randomness) will be generated from such public source of randomness." | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |