Skip to content

Commit 41d3587

Browse files
committed
update readme
1 parent 525368d commit 41d3587

2 files changed

Lines changed: 1 addition & 212 deletions

File tree

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ jobs:
116116
with:
117117
repository: ${{ github.repository }}
118118
ref: ${{ github.sha }}
119-
persist-credentials: true # needed for semantic-release to push tags and commits
119+
persist-credentials: ${{ ! inputs.dry_run }} # only persist credentials when not running in dry-run mode
120120

121121
- name: Checkout semantic-release workflow
122122
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd

README.md

Lines changed: 0 additions & 211 deletions
Original file line numberDiff line numberDiff line change
@@ -6,69 +6,17 @@ The workflows that are available to use are
66

77
## Workflow Index
88

9-
- [Combine Dependabot PRs](#combine-dependabot-prs)
109
- [Dependabot Auto Approve and Merge](#dependabot-auto-approve-and-merge)
11-
- [Sync copilot instructions](#sync-copilot-instructions)
1210
- [PR Title Check](#pr-title-check)
1311
- [Get Repo Config](#get-repo-config)
14-
- [Quality Checks](#quality-checks)
1512
- [Quality Checks - Dev Container Version](#quality-checks---dev-container-version)
16-
- [Update Dev Container Version](#update-dev-container-version)
17-
- [Tag Release](#tag-release)
1813
- [Tag Release - Devcontainer Version](#tag-release---devcontainer-version)
1914

2015
## Other Docs
2116

22-
- [Secret Scanning Docker](#secret-scanning-docker)
2317
- [Run All Releases](#run-all-releases)
2418

2519

26-
## Combine Dependabot PRs
27-
28-
This workflow can be called to combine multiple open Dependabot PRs into a single PR.
29-
30-
#### Inputs
31-
32-
- `branchPrefix`: Branch prefix to find combinable PRs based on. Default: `dependabot`
33-
- `mustBeGreen`: Only combine PRs that are green (status is success). Default: `true`
34-
- `combineBranchName`: Name of the branch to combine PRs into. Default: `combine-dependabot-PRs`
35-
- `ignoreLabel`: Exclude PRs with this label. Default: `nocombine`
36-
37-
#### Example
38-
39-
```yaml
40-
name: Combine Dependabot PRs
41-
42-
on:
43-
workflow_dispatch:
44-
inputs:
45-
branchPrefix:
46-
description: "Branch prefix to find combinable PRs based on"
47-
required: true
48-
type: string
49-
mustBeGreen:
50-
description: "Only combine PRs that are green (status is success)"
51-
required: true
52-
type: boolean
53-
combineBranchName:
54-
description: "Name of the branch to combine PRs into"
55-
required: true
56-
type: string
57-
ignoreLabel:
58-
description: "Exclude PRs with this label"
59-
required: true
60-
type: string
61-
62-
jobs:
63-
combine-dependabot-prs:
64-
uses: NHSDigital/eps-common-workflows/.github/workflows/combine-dependabot-prs.yml@f5c8313a10855d0cc911db6a9cd666494c00045a
65-
with:
66-
branchPrefix: ${{ github.event.inputs.branchPrefix }}
67-
mustBeGreen: ${{ github.event.inputs.mustBeGreen }}
68-
combineBranchName: ${{ github.event.inputs.combineBranchName }}
69-
ignoreLabel: ${{ github.event.inputs.ignoreLabel }}
70-
```
71-
7220
## Dependabot Auto Approve and Merge
7321
This workflow can be called to automatically approve and merge Dependabot PRs as part of the pull request workflow.
7422

@@ -92,40 +40,6 @@ jobs:
9240
AUTOMERGE_APP_ID: ${{ secrets.AUTOMERGE_APP_ID }}
9341
AUTOMERGE_PEM: ${{ secrets.AUTOMERGE_PEM }}
9442
```
95-
## Sync copilot instructions
96-
This workflow syncs Copilot instructions from this repo into another repo and opens a PR with the changes.
97-
It uses the environment secrets CREATE_PULL_REQUEST_APP_ID and CREATE_PULL_REQUEST_PEM that are defined in the create_pull_request environment in each repo
98-
99-
#### Inputs
100-
101-
- `common_workflows_ref`: Branch in common workflows repo to sync from. Default: `main`
102-
- `calling_repo_base_branch`: The base branch in the calling repository. Default: `main`.
103-
104-
105-
106-
#### Example
107-
108-
```yaml
109-
name: Sync Copilot Instructions
110-
111-
on:
112-
workflow_dispatch:
113-
inputs:
114-
common_workflows_ref:
115-
description: "Branch to sync from"
116-
required: false
117-
type: string
118-
default: main
119-
120-
jobs:
121-
sync-copilot:
122-
uses: NHSDigital/eps-common-workflows/.github/workflows/sync_copilot.yml@f5c8313a10855d0cc911db6a9cd666494c00045a
123-
with:
124-
ref: ${{ github.event.inputs.common_workflows_ref }}
125-
secrets:
126-
CREATE_PULL_REQUEST_APP_ID: ${{ secrets.CREATE_PULL_REQUEST_APP_ID }}
127-
CREATE_PULL_REQUEST_PEM: ${{ secrets.CREATE_PULL_REQUEST_PEM }}
128-
```
12943
## PR Title Check
13044
This workflow checks that all pull requests have a title that matches the required format, and comments on the PR with a link to the relevant ticket if a ticket reference is found.
13145
@@ -180,53 +94,6 @@ jobs:
18094
uses: NHSDigital/eps-common-workflows/.github/workflows/get-repo-config.yml@f5c8313a10855d0cc911db6a9cd666494c00045a
18195
```
18296

183-
## Quality Checks
184-
This workflow runs common quality checks.
185-
To use this, you must have the following Makefile targets defined
186-
- install
187-
- lint
188-
- test
189-
- install-node (only for cdk projects)
190-
- compile (only for cdk projects)
191-
- cdk-synth (only for cdk projects)
192-
- docker-build (only if run_docker_scan is set to true)
193-
194-
#### Inputs
195-
196-
- `install_java`: Whether to install Java or not
197-
- `run_sonar`: Whether to run Sonar checks or not.
198-
- `asdfVersion`: Override the version of asdf to install.
199-
- `reinstall_poetry`: If you are using this from a primarily Python based project, you should set this to true to force a poetry reinstallation after Python is installed
200-
- `run_docker_scan`: whether to run a scan of Docker images
201-
- `docker_images`: csv list of Docker images to scan. These must match images produced by make docker-build
202-
203-
#### Secret Inputs
204-
- `SONAR_TOKEN`: Token used to authenticate to Sonar
205-
206-
#### Outputs
207-
208-
None
209-
210-
#### Example
211-
212-
To use this workflow in your repository, call it from another workflow file:
213-
214-
```yaml
215-
name: Release
216-
217-
on:
218-
workflow_dispatch:
219-
220-
jobs:
221-
quality_checks:
222-
uses: NHSDigital/eps-common-workflows/.github/workflows/quality-checks.yml@f5c8313a10855d0cc911db6a9cd666494c00045a
223-
needs: [get_asdf_version]
224-
with:
225-
asdfVersion: ${{ needs.get_asdf_version.outputs.asdf_version }}
226-
secrets:
227-
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
228-
```
229-
23097
## Quality Checks - Dev Container Version
23198
This workflow runs common quality checks using a prebuilt devcontainer (https://github.com/NHSDigital/eps-devcontainers).
23299
To use this, you must have overridden any common makefile targets described in https://github.com/NHSDigital/eps-devcontainers?tab=readme-ov-file#common-makefile-targets
@@ -268,46 +135,6 @@ jobs:
268135
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
269136
```
270137

271-
## Update Dev Container Version
272-
This workflow updates `.devcontainer/devcontainer.json` with the latest published `v*` version for your configured devcontainer image from GHCR, then opens (or updates) a pull request with that change.
273-
274-
#### Requirements
275-
276-
- `.devcontainer/devcontainer.json` must include `build.args.IMAGE_NAME` and `build.args.IMAGE_VERSION`.
277-
- `CREATE_PULL_REQUEST_APP_ID` and `CREATE_PULL_REQUEST_PEM` secrets must be configured so the workflow can create a GitHub App token for PR creation.
278-
279-
#### Inputs
280-
281-
- `base_branch`: Target branch for the pull request. Default: `main`.
282-
283-
#### Secret Inputs
284-
285-
- `CREATE_PULL_REQUEST_APP_ID`: GitHub App ID used to generate an installation token.
286-
- `CREATE_PULL_REQUEST_PEM`: GitHub App private key used to generate an installation token.
287-
288-
#### Outputs
289-
290-
None
291-
292-
#### Example
293-
294-
To use this workflow in your repository, call it from another workflow file:
295-
296-
```yaml
297-
name: Update Devcontainer Version
298-
299-
on:
300-
workflow_dispatch:
301-
302-
jobs:
303-
update_devcontainer_version:
304-
uses: NHSDigital/eps-common-workflows/.github/workflows/update-dev-container-version.yml@f5c8313a10855d0cc911db6a9cd666494c00045a
305-
with:
306-
base_branch: main
307-
secrets:
308-
CREATE_PULL_REQUEST_APP_ID: ${{ secrets.CREATE_PULL_REQUEST_APP_ID }}
309-
CREATE_PULL_REQUEST_PEM: ${{ secrets.CREATE_PULL_REQUEST_PEM }}
310-
```
311138

312139
## Tag Release
313140
This workflow uses the semantic-release npm package to generate a new version tag, changelog, and GitHub release for a repo.
@@ -400,44 +227,6 @@ jobs:
400227
```
401228

402229

403-
## Secret Scanning Docker
404-
405-
The secret scanning also has a Dockerfile, which can be run against a repo in order to scan it manually (or as part of pre-commit hooks). This can be done like so:
406-
```bash
407-
docker build -f https://raw.githubusercontent.com/NHSDigital/eps-workflow-quality-checks/refs/tags/v3.0.0/dockerfiles/nhsd-git-secrets.dockerfile -t git-secrets .
408-
docker run -v /path/to/repo:/src git-secrets --scan-history .
409-
```
410-
For usage of the script, see the [source repo](https://github.com/NHSDigital/software-engineering-quality-framework/blob/main/tools/nhsd-git-secrets/git-secrets). Generally, you will either need `--scan -r .` or `--scan-history .`. The arguments default to `--scan -r .`, i.e. scanning the current state of the code.
411-
412-
In order to enable the pre-commit hook for secret scanning (to prevent developers from committing secrets in the first place), add the following to the `.devcontainer/devcontainer.json` file:
413-
```json
414-
{
415-
"remoteEnv": { "LOCAL_WORKSPACE_FOLDER": "${localWorkspaceFolder}" },
416-
"postAttachCommand": "docker build -f https://raw.githubusercontent.com/NHSDigital/eps-workflow-quality-checks/refs/tags/v4.0.2/dockerfiles/nhsd-git-secrets.dockerfile -t git-secrets . && pre-commit install --install-hooks -f",
417-
"features": {
418-
"ghcr.io/devcontainers/features/docker-outside-of-docker:1": {
419-
"version": "latest",
420-
"moby": "true",
421-
"installDockerBuildx": "true"
422-
}
423-
}
424-
}
425-
```
426-
427-
And add this pre-commit hook to the `.pre-commit-config.yaml` file:
428-
```yaml
429-
repos:
430-
- repo: local
431-
hooks:
432-
- id: git-secrets
433-
name: Git Secrets
434-
description: git-secrets scans commits, commit messages, and --no-ff merges to prevent adding secrets into your git repositories.
435-
entry: bash
436-
args:
437-
- -c
438-
- 'docker run -v "$LOCAL_WORKSPACE_FOLDER:/src" git-secrets --pre_commit_hook'
439-
language: system
440-
```
441230

442231
## Run All Releases
443232

0 commit comments

Comments
 (0)