Skip to content

Commit 1da857c

Browse files
authored
Chore: [AEA-6424] - new quality checks (#722)
## Summary - Routine Change ### Details - move to new quality checks
1 parent ace57bb commit 1da857c

16 files changed

Lines changed: 109 additions & 6115 deletions

.devcontainer/devcontainer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"args": {
77
"DOCKER_GID": "${env:DOCKER_GID:}",
88
"IMAGE_NAME": "regression_tests",
9-
"IMAGE_VERSION": "v1.2.0",
9+
"IMAGE_VERSION": "v1.4.6",
1010
"USER_UID": "${localEnv:USER_ID:}",
1111
"USER_GID": "${localEnv:GROUP_ID:}"
1212
}

.github/CODEOWNERS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# restrict access to approving workflow changes
2+
.github/workflows/ @NHSDigital/eps-administrators

.github/workflows/pull_request.yml

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,23 +4,32 @@ on:
44
pull_request:
55
branches: [main]
66

7-
env:
8-
BRANCH_NAME: ${{ github.event.pull_request.head.ref }}
9-
7+
permissions: {}
108
jobs:
119
dependabot-auto-approve-and-merge:
1210
needs: quality_checks
1311
uses: NHSDigital/eps-common-workflows/.github/workflows/dependabot-auto-approve-and-merge.yml@e798d5aee897de6f7dc387dd5623fcd9ba4c8929
12+
permissions:
13+
contents: write
14+
pull-requests: write
1415
secrets:
1516
AUTOMERGE_APP_ID: ${{ secrets.AUTOMERGE_APP_ID }}
1617
AUTOMERGE_PEM: ${{ secrets.AUTOMERGE_PEM }}
1718
get_config_values:
1819
uses: NHSDigital/eps-common-workflows/.github/workflows/get-repo-config.yml@e798d5aee897de6f7dc387dd5623fcd9ba4c8929
20+
permissions:
21+
attestations: read
22+
contents: read
23+
packages: read
1924
with:
2025
verify_published_from_main_image: false
2126

2227
quality_checks:
2328
uses: NHSDigital/eps-common-workflows/.github/workflows/quality-checks-devcontainer.yml@5ac2707dd9cd60ad127275179495b9c890d74711
29+
permissions:
30+
contents: read
31+
id-token: write
32+
packages: read
2433
needs: [get_config_values]
2534
with:
2635
pinned_image: ${{ needs.get_config_values.outputs.pinned_image }}
@@ -29,9 +38,15 @@ jobs:
2938

3039
pr_title_format_check:
3140
uses: NHSDigital/eps-common-workflows/.github/workflows/pr_title_check.yml@e798d5aee897de6f7dc387dd5623fcd9ba4c8929
32-
41+
permissions:
42+
pull-requests: write
3343
run_basic_regression_test:
3444
uses: ./.github/workflows/regression_tests.yml
45+
permissions:
46+
contents: read
47+
id-token: write
48+
packages: read
49+
attestations: read
3550
with:
3651
tags: "@ping"
3752
environment: INTERNAL-DEV
@@ -43,9 +58,9 @@ jobs:
4358
permissions:
4459
id-token: write
4560
contents: write
61+
packages: write
4662
with:
4763
dry_run: true
4864
pinned_image: ${{ needs.get_config_values.outputs.pinned_image }}
4965
branch_name: ${{ github.event.pull_request.head.ref }}
5066
tag_format: ${{ needs.get_config_values.outputs.tag_format }}
51-
secrets: inherit

.github/workflows/regression_tests.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ on:
7878
description: "Generate a report for successful test runs"
7979
default: false
8080

81+
permissions: {}
8182
jobs:
8283
regression_tests:
8384
runs-on: ubuntu-22.04
@@ -121,6 +122,10 @@ jobs:
121122
get_config_values:
122123
needs: regression_tests
123124
uses: NHSDigital/eps-common-workflows/.github/workflows/get-repo-config.yml@e798d5aee897de6f7dc387dd5623fcd9ba4c8929
125+
permissions:
126+
attestations: read
127+
contents: read
128+
packages: read
124129
with:
125130
verify_published_from_main_image: false
126131

@@ -158,9 +163,10 @@ jobs:
158163
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
159164
with:
160165
ref: ${{ inputs.github_tag }}
166+
persist-credentials: false
161167

162168
- name: Cache Virtualenv
163-
uses: actions/cache@v5
169+
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae
164170
id: cache-venv
165171
with:
166172
path: .venv
@@ -321,6 +327,7 @@ jobs:
321327
- name: Checkout
322328
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
323329
with:
330+
persist-credentials: false
324331
ref: ${{ inputs.github_tag }}
325332
- name: Cache Virtualenv
326333
uses: actions/cache@9255dc7a253b0ccc959486e2bca901246202afeb

.github/workflows/release.yml

Lines changed: 28 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,25 @@ on:
44
push:
55
branches: [main]
66

7-
env:
8-
BRANCH_NAME: ${{ github.event.ref.BRANCH_NAME }}
7+
permissions: {}
98

109
jobs:
1110
get_config_values:
1211
uses: NHSDigital/eps-common-workflows/.github/workflows/get-repo-config.yml@e798d5aee897de6f7dc387dd5623fcd9ba4c8929
12+
permissions:
13+
attestations: read
14+
contents: read
15+
packages: read
1316
with:
1417
verify_published_from_main_image: true
1518

1619
quality_checks:
1720
needs: [get_config_values]
1821
uses: NHSDigital/eps-common-workflows/.github/workflows/quality-checks-devcontainer.yml@5ac2707dd9cd60ad127275179495b9c890d74711
22+
permissions:
23+
contents: read
24+
id-token: write
25+
packages: read
1926
with:
2027
pinned_image: ${{ needs.get_config_values.outputs.pinned_image }}
2128
secrets:
@@ -36,15 +43,17 @@ jobs:
3643
permissions:
3744
id-token: write
3845
contents: write
46+
packages: write
3947
with:
4048
dry_run: false
4149
pinned_image: ${{ needs.get_config_values.outputs.pinned_image }}
4250
branch_name: main
4351
tag_format: ${{ needs.get_config_values.outputs.tag_format }}
44-
secrets: inherit
4552
generate_behave_steps_catalog:
4653
needs: [quality_checks, get_config_values]
4754
runs-on: ubuntu-22.04
55+
permissions:
56+
contents: write
4857
container:
4958
image: ${{ needs.get_config_values.outputs.pinned_image }}
5059
options: --user 1001:1001 --group-add 128
@@ -58,7 +67,7 @@ jobs:
5867
- name: Checkout code
5968
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
6069
with:
61-
ref: ${{ env.BRANCH_NAME }}
70+
persist-credentials: false
6271
fetch-depth: 0
6372

6473
- name: Cache Virtualenv
@@ -71,11 +80,15 @@ jobs:
7180
- name: Install python packages
7281
if: steps.cache-venv.outputs.cache-hit != 'true'
7382
run: make install
74-
83+
- name: Checkout gh-pages
84+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
85+
with:
86+
ref: gh-pages
87+
path: gh-pages
88+
persist-credentials: true
7589
- name: Generate Behave steps catalog as HTML
7690
run: |
7791
set +H # Disable history expansion to prevent !DOCTYPE error
78-
mkdir -p docs
7992
{
8093
echo "<!DOCTYPE html>"
8194
echo "<html lang='en'>"
@@ -99,11 +112,13 @@ jobs:
99112
echo " </pre>"
100113
echo "</body>"
101114
echo "</html>"
102-
} > docs/index.html
115+
} > gh-pages/index.html
103116
104-
- name: Deploy to GitHub Pages
105-
uses: peaceiris/actions-gh-pages@4f9cc6602d3f66b9c108549d475ec49e8ef4d45e
106-
with:
107-
github_token: ${{ secrets.GITHUB_TOKEN }}
108-
publish_dir: ./docs
109-
publish_branch: gh-pages # Change if using another branch
117+
- name: Update docs in github pages
118+
run: |
119+
cd gh-pages
120+
git config user.name github-actions
121+
git config user.email github-actions@github.com
122+
git add "index.html"
123+
git commit -m "update behave catalogue"
124+
parallel --retries 10 --delay 3 ::: "git pull --rebase && git push"

.github/workflows/sync_copilot.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ on:
44
workflow_dispatch:
55
schedule:
66
- cron: "0 6 * * 1"
7+
permissions: {}
78

89
jobs:
910
sync-copilot-instructions:

0 commit comments

Comments
 (0)