Volitve EP2024 update #1099
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: Volitve EP2024 update | |
# Controls when the action will run. Triggers the workflow on push or pull request | |
# events but only for the master branch | |
on: | |
push: | |
branches: [ main ] | |
paths: | |
- '.github/workflows/update.yml' | |
- 'update.sh' | |
pull_request: | |
branches: [ main ] | |
paths: | |
- '.github/workflows/update.yml' | |
- 'update.sh' | |
schedule: | |
# * is a special character in YAML so you have to quote this string | |
- cron: '30 */1 * 5-6 *' | |
- cron: '2/5 * 9-10 6 *' | |
workflow_dispatch: | |
permissions: | |
contents: write | |
# A workflow run is made up of one or more jobs that can run sequentially or in parallel | |
jobs: | |
# This workflow contains a single job called "build" | |
update: | |
# The type of runner that the job will run on | |
runs-on: self-hosted | |
# Steps represent a sequence of tasks that will be executed as part of the job | |
steps: | |
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it | |
- uses: actions/checkout@v4 | |
# Runs a single command using the runners shell | |
- run: ./update.sh ep2024 | |
- run: ./update.sh referendum-evtanazija | |
- run: ./update.sh referendum-preferencni-glas | |
- run: ./update.sh referendum-konoplja-medicina | |
- run: ./update.sh referendum-konoplja-raba | |
# Runs a set of commands using the runners shell | |
- name: Check git diff | |
id: verify_diff | |
run: | | |
ls -la */* | |
git add data/* | |
git status | |
git diff --staged --quiet . || echo "changed=true" >> $GITHUB_OUTPUT | |
# Git commit + push, see https://github.com/github-actions-x/commit | |
- name: Publish volišča changes to git | |
if: github.ref == 'refs/heads/main' && steps.verify_diff.outputs.changed == 'true' | |
run: | | |
git config user.name "DVK Volitve EP2024 scrape bot 🤖" | |
git config user.email "" | |
git config commit.gpgsign false | |
git commit -m "DVK Volitve EP2024 update 🤖" data/ | |
git pull --rebase | |
git push origin main |