Skip to content

Commit 003c7aa

Browse files
authored
Update and standardise GitHub Actions (#2009)
2 parents e30d984 + 880f5aa commit 003c7aa

4 files changed

Lines changed: 37 additions & 27 deletions

File tree

.github/workflows/check_links.yml

Lines changed: 21 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,28 @@
1-
---
2-
name: 'Check links'
1+
name: "Check links"
32

43
# yamllint disable-line rule:truthy
54
on:
65
workflow_dispatch:
76
schedule:
8-
- cron: '37 11 * * 2'
7+
- cron: "37 11 * * 2"
98

109
permissions:
1110
contents: read
1211

1312
jobs:
14-
1513
links:
1614
runs-on: ubuntu-latest
1715
steps:
1816
- name: Checkout repo
19-
uses: actions/checkout@v7.0.0
17+
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
18+
with:
19+
persist-credentials: false
2020

2121
- name: Install Python and just
22-
uses: opensafely-core/setup-action@v1
22+
uses: opensafely-core/setup-action@d9171097dd0d37bdb7bed58f701eb03ff317ed17 # v1.7.0
2323
with:
2424
install-just: true
25-
python-version: '3.11'
25+
python-version: "3.11"
2626

2727
- name: Build site
2828
env:
@@ -38,9 +38,18 @@ jobs:
3838
# This workaround may not be needed in future if lychee has better rate limiting.
3939
# https://github.com/lycheeverse/lychee/issues/36
4040
- name: Check links
41-
# 2.6.1 seemed to cause the exclude-path to not take effect, waiting for next release.
42-
uses: lycheeverse/lychee-action@82202e5e9c2f4ef1a55a3d02563e1cb6041e5332 # v2.4.1
41+
uses: lycheeverse/lychee-action@e7477775783ea5526144ba13e8db5eec57747ce8 # v2.9.0
4342
with:
44-
args: "--exclude-all-private --include-verbatim --max-concurrency 24 --require-https --verbose --no-progress --offline
45-
--accept '100..=103,200..=299,429,500..=511'
46-
--timeout 60 './docs/**/*.md' './docs/**/*.html' './imported_docs/**/*.md' './imported_docs/**/*.html' --exclude-path './docs/ehrql/includes/generated_docs'"
43+
args:
44+
"--accept '100..=103,200..=299,429,500..=511'
45+
--exclude-all-private
46+
--exclude-path 'docs/ehrql/includes/generated_docs'
47+
--include-verbatim
48+
--max-concurrency 24
49+
--no-progress
50+
--offline
51+
--require-https
52+
--root-dir '${{ github.workspace }}/site'
53+
--timeout 60
54+
--verbose
55+
'./docs/**/*.md' './docs/**/*.html'"

.github/workflows/check_redirects.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
1-
---
2-
name: 'Check Cloudflare redirects'
1+
name: "Check Cloudflare redirects"
32

43
# yamllint disable-line rule:truthy
54
on:
65
workflow_dispatch:
76
schedule:
8-
- cron: '25 10 * * 2'
7+
- cron: "25 10 * * 2"
98

109
permissions:
1110
contents: read
@@ -15,7 +14,9 @@ jobs:
1514
runs-on: ubuntu-latest
1615
steps:
1716
- name: Checkout repo
18-
uses: actions/checkout@v7.0.0
17+
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
18+
with:
19+
persist-credentials: false
1920

2021
- name: Check Cloudflare redirects
2122
run: |

.github/workflows/check_vale.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
---
2-
name: 'Check docs with Vale'
1+
name: "Check docs with Vale"
32

43
# yamllint disable-line rule:truthy
54
on:
@@ -13,10 +12,12 @@ jobs:
1312
runs-on: ubuntu-latest
1413
steps:
1514
- name: Checkout repo
16-
uses: actions/checkout@v7.0.0
15+
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
16+
with:
17+
persist-credentials: false
1718

1819
- name: Install just
19-
uses: opensafely-core/setup-action@v1
20+
uses: opensafely-core/setup-action@d9171097dd0d37bdb7bed58f701eb03ff317ed17 # v1.7.0
2021
with:
2122
install-just: true
2223

.github/workflows/pages-deployment.yml

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,11 @@
1-
---
2-
name:
3-
"Build & deploy to Cloudflare Pages"
1+
name: "Build & deploy to Cloudflare Pages"
42

53
on:
64
push:
75
workflow_dispatch:
86

97
jobs:
108
deploy:
11-
129
permissions:
1310
contents: read
1411
deployments: write
@@ -18,13 +15,15 @@ jobs:
1815
name: Deploy to Cloudflare Pages
1916
steps:
2017
- name: Checkout repo
21-
uses: actions/checkout@v7.0.0
18+
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
19+
with:
20+
persist-credentials: false
2221

2322
- name: Install Python and just
24-
uses: opensafely-core/setup-action@v1
23+
uses: opensafely-core/setup-action@d9171097dd0d37bdb7bed58f701eb03ff317ed17 # v1.7.0
2524
with:
2625
install-just: true
27-
python-version: '3.11'
26+
python-version: "3.11"
2827

2928
- name: Build site
3029
env:

0 commit comments

Comments
 (0)