Update alphagov references to govuk-forms#1110
Conversation
| jobs: | ||
| build-image: | ||
| uses: alphagov/forms-deploy/.github/workflows/reusable-build-image.yml@main | ||
| uses: govuk-forms/forms-deploy/.github/workflows/reusable-build-image.yml@main |
Check warning
Code scanning / CodeQL
Workflow does not contain permissions Medium
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix
AI 20 days ago
In general, the fix is to add an explicit permissions block to the workflow (either at the root level or within the specific job) that grants only the minimal permissions required. For a typical build-only workflow that just checks out code and builds a Docker image, read-only access to repository contents (contents: read) is usually sufficient. If the reusable workflow needs more (e.g., to push images or create releases), those scopes can be added there; but given the information available, the minimal safe baseline is to set contents: read at the job level.
The best change with minimal impact is to add a permissions block under the build-image job in .github/workflows/docker_build.yml. That way, we constrain the GITHUB_TOKEN used for this job (and therefore for the called reusable workflow) without altering the triggering conditions or job structure. Concretely, in .github/workflows/docker_build.yml, under jobs:, inside build-image:, we will insert:
permissions:
contents: readwith proper indentation, just before the existing uses: line. No additional methods, imports, or definitions are needed, as this is pure workflow configuration.
| @@ -8,4 +8,6 @@ | ||
| types: [checks_requested] | ||
| jobs: | ||
| build-image: | ||
| permissions: | ||
| contents: read | ||
| uses: govuk-forms/forms-deploy/.github/workflows/reusable-build-image.yml@main |
| jobs: | ||
| lint-workflows: | ||
| uses: alphagov/forms-deploy/.github/workflows/reusable-lint-workflows.yml@main | ||
| uses: govuk-forms/forms-deploy/.github/workflows/reusable-lint-workflows.yml@main |
Check warning
Code scanning / CodeQL
Workflow does not contain permissions Medium
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix
AI 20 days ago
In general, the fix is to add an explicit permissions block that grants only the minimal required scopes for GITHUB_TOKEN. For a workflow that just lints workflow files (no pushing, no status writes beyond what GitHub itself does, no issue manipulation), contents: read is typically sufficient at the workflow level.
For this specific file (.github/workflows/lint-workflows.yml), the best, non-functional change is to add a root-level permissions block applying to all jobs. It should go between the on: block and the jobs: block to follow common style and avoid altering the job definition. The block will be:
permissions:
contents: readNo additional imports or dependencies are needed; this is purely a configuration change in the workflow YAML. Only the shown snippet needs editing: insert the permissions section after line 9 and before line 10.
| @@ -7,6 +7,9 @@ | ||
| - '.github/workflows/*.yml' | ||
| - '.github/workflows/*.yaml' | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| lint-workflows: | ||
| uses: govuk-forms/forms-deploy/.github/workflows/reusable-lint-workflows.yml@main |
84e4258 to
e7942e2
Compare
|
I think the SHA pinning check is failing because you missed updating alphagov -> govuk-forms in .github/workflows/review_apps_on_pr_close.yml |
We have transferred all repos to govuk-forms
e7942e2 to
9bcb8cf
Compare
|
🎉 A review copy of this PR has been deployed! You can reach it at: https://pr-1110.www.review.forms.service.gov.uk/ It may take 5 minutes or so for the application to be fully deployed and working. If it still isn't ready For the sign in details and more information, see the review apps wiki page. |
What problem does this pull request solve?
We have transferred all repos to govuk-forms
Trello card:
Things to consider when reviewing