generated from ministryofjustice/hmpps-template-typescript
-
Notifications
You must be signed in to change notification settings - Fork 1
34 lines (32 loc) · 1.06 KB
/
fetch-bank-holidays.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
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