Skip to content

Fetch bank holidays JSON from the gov.uk API #525

Fetch bank holidays JSON from the gov.uk API

Fetch bank holidays JSON from the gov.uk API #525

name: Fetch bank holidays JSON from the gov.uk API
on:
schedule:
- cron: '0 0 * * *'
jobs:
update_bank_holidays:
name: Call API
runs-on: ubuntu-latest
steps:
- name: Generate Token
uses: tibdex/github-app-token@v2
id: generate-token
with:
app_id: ${{ secrets.APP_ID }}
private_key: ${{ secrets.APP_PRIVATE_KEY }}
- name: Checkout
uses: actions/[email protected]
- name: Call API
id: call_api
run: |
curl -o bank-holidays.json https://www.gov.uk/bank-holidays.json
mv bank-holidays.json ./server/data/bankHolidays/bank-holidays.json
- name: Create Pull Request
uses: peter-evans/create-pull-request@v7
with:
token: ${{ steps.generate-token.outputs.token }}
title: 'Bank holiday updates'
commit-message: 'Update bank holidays'
body: 'This PR updates the bank holidays JSON file from the gov.uk API.'
delete-branch: true
branch-suffix: timestamp
branch: bank-holiday-updates