Skip to content

Commit 8404cf6

Browse files
Chore: [AEA-0000] - Removes unused inputs and updates readme (#74)
## Summary - Routine Change ### Details Readme updates for new workflows and interfaces
1 parent 2a08351 commit 8404cf6

4 files changed

Lines changed: 74 additions & 67 deletions

File tree

.github/workflows/pull_request.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,23 @@ jobs:
1414
secrets:
1515
AUTOMERGE_APP_ID: ${{ secrets.AUTOMERGE_APP_ID }}
1616
AUTOMERGE_PEM: ${{ secrets.AUTOMERGE_PEM }}
17+
1718
pr_title_format_check:
1819
uses: ./.github/workflows/pr_title_check.yml
20+
1921
get_config_values:
2022
uses: ./.github/workflows/get-repo-config.yml
23+
with:
24+
verify_published_from_main_image: false
25+
2126
quality_checks:
2227
uses: ./.github/workflows/quality-checks-devcontainer.yml
2328
needs: [get_config_values]
2429
with:
2530
pinned_image: ${{ needs.get_config_values.outputs.pinned_image }}
2631
secrets:
2732
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
33+
2834
tag_release:
2935
needs: get_config_values
3036
uses: ./.github/workflows/tag-release-devcontainer.yml
@@ -37,5 +43,4 @@ jobs:
3743
pinned_image: ${{ needs.get_config_values.outputs.pinned_image }}
3844
branch_name: ${{ github.event.pull_request.head.ref }}
3945
tag_format: ${{ needs.get_config_values.outputs.tag_format }}
40-
verify_published_from_main_image: false
4146
secrets: inherit

.github/workflows/release.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,5 +25,4 @@ jobs:
2525
pinned_image: ${{ needs.get_config_values.outputs.pinned_image }}
2626
branch_name: main
2727
tag_format: ${{ needs.get_config_values.outputs.tag_format }}
28-
verify_published_from_main_image: true
2928
secrets: inherit

.github/workflows/tag-release-devcontainer.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,6 @@ on:
4545
description: "An repository for the extra artifact"
4646
required: false
4747
type: string
48-
verify_published_from_main_image:
49-
required: true
50-
type: boolean
5148
outputs:
5249
version_tag:
5350
value: ${{ jobs.tag_release.outputs.version_tag }}

README.md

Lines changed: 68 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ The workflows that are available to use are
99
- [Combine Dependabot PRs](#combine-dependabot-prs)
1010
- [Dependabot Auto Approve and Merge](#dependabot-auto-approve-and-merge)
1111
- [PR Title Check](#pr-title-check)
12+
- [Get Repo Config](#get-repo-config)
1213
- [Quality Checks](#quality-checks)
1314
- [Quality Checks - Dev Container Version](#quality-checks---dev-container-version)
14-
- [Verify Image Digest and Attestation](#verify-image-digest-and-attestation)
1515
- [Tag Release](#tag-release)
1616
- [Tag Release - Devcontainer Version](#tag-release---devcontainer-version)
1717

@@ -127,6 +127,41 @@ jobs:
127127
uses: NHSDigital/eps-common-workflows/.github/workflows/pr_title_check.yml@f5c8313a10855d0cc911db6a9cd666494c00045a
128128
```
129129

130+
## Get Repo Config
131+
132+
This workflow extracts common config values, including the devcontainer image and version. This image then has its attestations verified, and provides a pinned image reference that can be used in downstream workflows.
133+
134+
#### Inputs
135+
136+
- `registry`: Container registry host. Default: `ghcr.io`
137+
- `namespace`: Image namespace/repository prefix. Default: `nhsdigital/eps-devcontainers`
138+
- `owner`: GitHub owner used by `gh attestation verify --owner`. Default: `NHSDigital`
139+
- `verify_published_from_main_image`: If true, verifies attestations published from `refs/heads/main`. Default: `true`
140+
- `predicate_type`: Attestation predicate type. Default: `https://slsa.dev/provenance/v1`
141+
142+
#### Outputs
143+
144+
- `tag_format`: The tag format to use for releases.
145+
- `devcontainer_image`: The devcontainer image name as defined in `.devcontainer/devcontainer.json`.
146+
- `devcontainer_version`: The version of the devcontainer image.
147+
- `pinned_image`: The fully-qualified digest-pinned image reference.
148+
- `resolved_digest`: The resolved digest for the devcontainer image.
149+
150+
#### Example
151+
152+
To use this workflow in your repository, call it from another workflow file:
153+
154+
```yaml
155+
name: Release
156+
157+
on:
158+
workflow_dispatch:
159+
160+
jobs:
161+
get_config_values:
162+
uses: NHSDigital/eps-common-workflows/.github/workflows/get-repo-config.yml@f5c8313a10855d0cc911db6a9cd666494c00045a
163+
```
164+
130165
## Quality Checks
131166
This workflow runs common quality checks.
132167
To use this, you must have the following Makefile targets defined
@@ -182,7 +217,7 @@ To use this, you must have overridden any common makefile targets described in h
182217
- `run_sonar`: Whether to run Sonar checks or not.
183218
- `run_docker_scan`: whether to run a scan of Docker images
184219
- `docker_images`: csv list of Docker images to scan. These must match images produced by make docker-build
185-
- `runtime_docker_image`: the Docker image to run everything on. This should just be the image name and tag pushed to https://github.com/NHSDigital/eps-devcontainers
220+
- `pinned_image`: A pinned, verified image version upon which to run the container.
186221
#### Secret Inputs
187222
- `SONAR_TOKEN`: Token used to authenticate to Sonar
188223

@@ -201,73 +236,41 @@ on:
201236
workflow_dispatch:
202237
203238
jobs:
239+
get_config_values:
240+
uses: NHSDigital/eps-common-workflows/.github/workflows/get-repo-config.yml@f5c8313a10855d0cc911db6a9cd666494c00045a
241+
204242
quality_checks:
205-
uses: NHSDigital/eps-common-workflows/.github/workflows/quality-checks.yml@f5c8313a10855d0cc911db6a9cd666494c00045a
243+
uses: NHSDigital/eps-common-workflows/.github/workflows/quality-checks-devcontainer.yml@f5c8313a10855d0cc911db6a9cd666494c00045a
206244
needs: [get_config_values]
207245
with:
208-
runtime_docker_image: "${{ needs.get_config_values.outputs.devcontainer_image }}:githubactions-${{ needs.get_config_values.outputs.devcontainer_version }}"
246+
pinned_image: ${{ needs.get_config_values.outputs.pinned_image }}
209247
run_docker_scan: true
210248
docker_images: fhir-facade,validator
211249
secrets:
212250
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
213251
```
214252

215-
## Verify Image Digest and Attestation
216-
This workflow resolves an image reference to a pinned digest and verifies GitHub artifact attestation for that image.
217-
218-
#### Inputs
219-
220-
- `runtime_docker_image`: Image reference as `name:tag` (for example `node_24_python_3_12:v1.2.3`) or a fully qualified image reference.
221-
- `registry`: Container registry host. Default: `ghcr.io`
222-
- `namespace`: Image namespace/repository prefix. Default: `nhsdigital/eps-devcontainers`
223-
- `owner`: GitHub owner used by `gh attestation verify --owner`. Default: `NHSDigital`
224-
- `verify_published_from_main_image`: If true, verifies attestations published from `refs/heads/main`. Default: `true`
225-
- `predicate_type`: Attestation predicate type. Default: `https://slsa.dev/provenance/v1`
226-
227-
#### Outputs
228-
229-
- `pinned_image`: Fully-qualified digest-pinned image reference.
230-
- `resolved_digest`: Resolved digest for the supplied image reference.
231-
232-
#### Example
233-
234-
To use this workflow in your repository, call it from another workflow file:
235-
236-
```yaml
237-
name: Verify Devcontainer Image
238-
239-
on:
240-
workflow_dispatch:
241-
242-
jobs:
243-
verify_attestation:
244-
uses: NHSDigital/eps-common-workflows/.github/workflows/verify-attestation.yml@f5c8313a10855d0cc911db6a9cd666494c00045a
245-
with:
246-
runtime_docker_image: node_24_python_3_12:githubactions-v1.2.3
247-
registry: ghcr.io
248-
namespace: nhsdigital/eps-devcontainers
249-
owner: NHSDigital
250-
verify_published_from_main_image: true
251-
predicate_type: https://slsa.dev/provenance/v1
252-
```
253-
254-
255253
## Tag Release
256254
This workflow uses the semantic-release npm package to generate a new version tag, changelog, and GitHub release for a repo.
257255

258256
#### Inputs
259257

260258
- `dry_run`: Whether to run in dry_run mode (do not create tags) or not
261-
- `tagFormat`: Default `v\\${version}`. A template for the version tag.
259+
- `tag_format`: Default `v\\${version}`. A template for the version tag.
262260
- `branch_name`: The branch name to base the release on
263-
- `publish_package`: Default false. If true, semantic-release will publish npm package.
261+
- `publish_packages`: comma separated list of package folders to publish to an npm registry
264262
- `asdfVersion`: Override the version of asdf to install.
265263
- `main_branch`: The branch to use for publishing. Defaults to main
264+
- `extra_artifact_name`: optional param to include an extra artifact in the release
265+
- `extra_artifact_id`: optional param of the extra artifact id to include in the release
266+
- `extra_artifact_run_id`: optional param of the run id to download the extra artifact id to include in the release
267+
- `extra_artifact_repository`: optional param to indicate which repo the run to download the artifact was from
266268

267269
#### Outputs
268270

269271
- `version_tag`: The version tag created by semantic-release.
270272
- `change_set_version`: A timestamped string that can be used for creating changesets.
273+
- `next_version_tag`: The next version tag that will be created.
271274

272275
#### Example
273276

@@ -282,12 +285,12 @@ on:
282285
jobs:
283286
tag_release:
284287
uses: NHSDigital/eps-common-workflows/.github/workflows/tag-release.yml@f5c8313a10855d0cc911db6a9cd666494c00045a
285-
with:
286-
tagFormat: "v\\${version}-beta"
287-
dry_run: true
288-
asdfVersion: 0.18.0
289-
branch_name: main
290-
publish_package: false
288+
with:
289+
tag_format: "v\\${version}-beta"
290+
dry_run: true
291+
asdfVersion: 0.18.0
292+
branch_name: main
293+
publish_packages: ""
291294
```
292295

293296
## Tag Release - Devcontainer Version
@@ -297,20 +300,20 @@ This workflow uses the semantic-release npm package to generate a new version ta
297300

298301
- `dry_run`: Whether to run in dry_run mode (do not create tags) or not
299302
- `branch_name`: The branch name to base the release on
300-
- `runtime_docker_image`: the Docker image to run everything on. This should just be the image name and tag pushed to https://github.com/NHSDigital/eps-devcontainers
303+
- `pinned_image`: A pinned, verified image version upon which to run the container.
301304
- `publish_packages`: comma separated list of package folders to publish to an npm registry
302-
- `tagFormat`: Default `v\\${version}`. A template for the version tag.
305+
- `tag_format`: Default `v\\${version}`. A template for the version tag.
303306
- `main_branch`: The branch to use for publishing. Defaults to main
304307
- `extra_artifact_name`: optional param to include an extra artifact in the release
305308
- `extra_artifact_id`: optional param of the extra artifact id to include in the release
306309
- `extra_artifact_run_id`: optional param of the run id to download the extra artifact id to include in the release
307-
- `extra_artifact_repository` optional param to indicate which repo the run to download the artifact was from
308-
- `verify_published_from_main_image` indicates if we should verify the image was published from main branch in eps-devcontainers
310+
- `extra_artifact_repository`: optional param to indicate which repo the run to download the artifact was from
309311

310312
#### Outputs
311313

312314
- `version_tag`: The version tag created by semantic-release.
313315
- `change_set_version`: A timestamped string that can be used for creating changesets.
316+
- `next_version_tag`: The next version tag that will be created.
314317

315318
#### Example
316319

@@ -323,15 +326,18 @@ on:
323326
workflow_dispatch:
324327
325328
jobs:
329+
get_config_values:
330+
uses: NHSDigital/eps-common-workflows/.github/workflows/get-repo-config.yml@f5c8313a10855d0cc911db6a9cd666494c00045a
331+
326332
tag_release:
327333
uses: NHSDigital/eps-common-workflows/.github/workflows/tag-release-devcontainer.yml@f5c8313a10855d0cc911db6a9cd666494c00045a
328334
needs: [get_config_values]
329-
with:
330-
tagFormat: "v\\${version}-beta"
331-
dry_run: true
332-
runtime_docker_image: "${{ needs.get_config_values.outputs.devcontainer_image }}:githubactions-${{ needs.get_config_values.outputs.devcontainer_version }}"
333-
branch_name: main
334-
publish_package: false
335+
with:
336+
tag_format: "v\\${version}-beta"
337+
dry_run: true
338+
pinned_image: "${{ needs.get_config_values.outputs.pinned_image }}"
339+
branch_name: main
340+
publish_packages: ""
335341
```
336342

337343

0 commit comments

Comments
 (0)