Skip to content

Aggregate Polls

Aggregate Polls #26740

name: 'Aggregate Polls'
on:
push:
branches:
- master
paths:
- governance/polls/**
- '!governance/polls/meta/polls.json'
- '!governance/polls/meta/hashed-polls.json'
- '!governance/polls/meta/polls-goerli.json'
- '!governance/polls/meta/hashed-polls-goerli.json'
workflow_dispatch:
schedule:
# Run the action every 30 minutes
- cron: '*/30 * * * *'
jobs:
aggregate_polls:
runs-on: ubuntu-latest
name: Aggregates all of the polls into a single file, creating a pull request with the new file.
steps:
- uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.ref }}
- name: Upload
id: upload
uses: hernandoagf/aggregate-polls-action@v1.2.4
with:
network: 'mainnet'
tags-file: 'governance/polls/meta/poll-tags.json'
output-file: 'governance/polls/meta/polls.json'
hash-file: 'governance/polls/meta/hashed-polls.json'
- name: Update pull request with polls changes
uses: EndBug/add-and-commit@v9 # You can change this to use a specific version.
with:
author_name: github-actions[bot]
author_email: github-actions[bot]@users.noreply.github.com
message: 'Added polls aggregated file'
add: 'governance/polls/meta/polls.json'
fetch: false
push: false
- name: Create Pull Request
uses: peter-evans/create-pull-request@v4
with:
title: 'Automatic update to the polls aggregated file'