Check for updates to GOV.UK bank holiday JSON #299
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: Check for updates to GOV.UK bank holiday JSON | |
on: | |
schedule: | |
# Runs every day at 12:30pm | |
- cron: '30 12 * * *' | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Check for updates | |
run: | | |
set +e | |
python manage_bank_holidays.py --diff | |
if [[ $? -ne 0 ]]; then | |
echo "New bank holiday JSON is live" | |
curl \ | |
-X POST \ | |
-H "Accept: application/vnd.github.v3+json" \ | |
-H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \ | |
https://api.github.com/repos/DemocracyClub/uk-election-timetables/issues \ | |
-d '{"title":"Update bank-holidays.json from GOV.UK"}' | |
else | |
echo "bank-holidays.json is up to date" | |
fi |