Skip to content

Check for updates to GOV.UK bank holiday JSON #298

Check for updates to GOV.UK bank holiday JSON

Check for updates to GOV.UK bank holiday JSON #298

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