Chore: [AEA-0000] - workflow to sync copilot instructions#62
Chore: [AEA-0000] - workflow to sync copilot instructions#62anthony-nhs wants to merge 29 commits intomainfrom
Conversation
|
This PR is linked to a ticket in an NHS Digital JIRA Project. Here's a handy link to the ticket: AEA-0000 |
|
There was a problem hiding this comment.
Pull request overview
Adds a reusable GitHub Actions workflow and supporting Copilot configuration files intended to sync Copilot instructions from this repository into other repositories via an automated PR.
Changes:
- Document a new “Sync Copilot Instructions” reusable workflow in
README.md. - Add
.github/workflows/sync_copilot.ymlto fetch instruction assets from the central repo and open a PR with updates. - Add Copilot instruction assets under
.github/instructions/**, plus.github/copilot-instructions.mdand a chatmode file.
Reviewed changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 18 comments.
Show a summary per file
| File | Description |
|---|---|
README.md |
Documents the new sync workflow and provides a usage example. |
.github/workflows/sync_copilot.yml |
Implements the reusable workflow that syncs instructions into a target repo and creates a PR. |
.github/instructions/languages/INSTRUCTIONS-TYPESCRIPT.md |
Adds TypeScript guidance content. |
.github/instructions/languages/INSTRUCTIONS-TERRAFORM.md |
Adds Terraform guidance content. |
.github/instructions/languages/INSTRUCTIONS-SAM.md |
Adds SAM guidance content. |
.github/instructions/languages/INSTRUCTIONS-PYTHON.md |
Adds Python guidance content. |
.github/instructions/languages/INSTRUCTIONS-KOTLIN.md |
Adds Kotlin guidance content. |
.github/instructions/languages/INSTRUCTIONS-JAVA.md |
Adds Java guidance content. |
.github/instructions/languages/INSTRUCTIONS-CLOUDFORMATION.md |
Adds CloudFormation guidance content. |
.github/instructions/languages/INSTRUCTIONS-CDK.md |
Adds CDK guidance content. |
.github/instructions/instructions.intstructions.md |
Adds guidance for authoring instruction files. |
.github/instructions/general/SECURITY.md |
Adds security-focused guidance intended to apply broadly. |
.github/copilot-instructions.md |
Adds base Copilot instructions and links to other instruction files. |
.github/chatmodes/create_instructions.chatmode.md |
Adds a chatmode intended to help generate instruction files. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 12 out of 12 changed files in this pull request and generated 9 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 12 out of 12 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 12 out of 12 changed files in this pull request and generated 9 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| commit-message: "Upgrade: [dependabot] - sync Copilot instructions" | ||
| title: "Upgrade: [dependabot] - sync Copilot instructions" |
There was a problem hiding this comment.
The PR title/commit message uses [dependabot], but the PR will be created by peter-evans/create-pull-request (not Dependabot). In repos that run pr_title_check.yml, this will trigger the "raised by Dependabot" comment, which is inaccurate. Consider using a real ticket reference, or introduce a separate allowed token (e.g., [automation]) and update the title-check workflow accordingly.
| commit-message: "Upgrade: [dependabot] - sync Copilot instructions" | |
| title: "Upgrade: [dependabot] - sync Copilot instructions" | |
| commit-message: "Upgrade: sync Copilot instructions" | |
| title: "Upgrade: sync Copilot instructions" |
| @@ -0,0 +1,175 @@ | |||
| --- | |||
| description: 'Guidelines for writing high-quality, maintainable TypeScript code with best practices for logging, error handling, code organization, naming, formatting, and style.' | |||
| applyTo: '**/*.ts, **/*.tsx' | |||
There was a problem hiding this comment.
applyTo: '**/*.ts, **/*.tsx' is likely not a valid glob (the comma/space will typically be treated as literal characters), meaning these instructions may never apply. Prefer a single glob like **/*.{ts,tsx} or split into separate instruction files/patterns.
| applyTo: '**/*.ts, **/*.tsx' | |
| applyTo: '**/*.{ts,tsx}' |
| @@ -0,0 +1,18 @@ | |||
| # EPS Common Workflow - copilot instructions | |||
There was a problem hiding this comment.
In the heading, "copilot" should be capitalized as "Copilot" for consistency with GitHub naming.
| # EPS Common Workflow - copilot instructions | |
| # EPS Common Workflow - Copilot instructions |
| # EPS Common Workflow - copilot instructions | ||
|
|
||
| ## Overview | ||
| This contains common github workflows that are used by other EPS projects |
There was a problem hiding this comment.
"github" should be capitalized as "GitHub" (brand name) since this file is intended for broad reuse.
| ## General | ||
| These rules should be followed for all workflows | ||
|
|
||
| *NEVER* use a version number in 3rd party actions or workflows - always use the git commit sha instead |
There was a problem hiding this comment.
Consider writing "Git commit SHA" (or "commit SHA") instead of "git commit sha" for consistent capitalization of the tool name and acronym.
| *NEVER* use a version number in 3rd party actions or workflows - always use the git commit sha instead | |
| *NEVER* use a version number in 3rd party actions or workflows - always use the Git commit SHA instead |
| 9. **Build Methods**: Use esbuild for Node.js Lambda functions | ||
| 10. **Version Pinning**: Pin Lambda layer versions and runtimes |
There was a problem hiding this comment.
The numbered list skips from 7 to 9, which looks like a numbering mistake and makes the guidance harder to reference. Renumber the items so the sequence is continuous.
| 9. **Build Methods**: Use esbuild for Node.js Lambda functions | |
| 10. **Version Pinning**: Pin Lambda layer versions and runtimes | |
| 8. **Build Methods**: Use esbuild for Node.js Lambda functions | |
| 9. **Version Pinning**: Pin Lambda layer versions and runtimes |
| ### Standard Parameters | ||
| Always include these common parameters in templates: | ||
| ```yaml | ||
| Parameters |
There was a problem hiding this comment.
In the CloudFormation/SAM example, Parameters is missing the trailing colon (Parameters:). As written, the snippet is invalid YAML/CloudFormation and could mislead users copying it.
| Parameters | |
| Parameters: |
.github/workflows/sync_copilot.yml
Outdated
| contents: write | ||
| pull-requests: write |
There was a problem hiding this comment.
permissions.contents is set to write, but this workflow can likely operate with contents: read because the PR creation uses a separate GitHub App token. Consider reducing the default GITHUB_TOKEN permissions to least-privilege (consistent with other workflows like update-dev-container-version.yml).
| contents: write | |
| pull-requests: write | |
| contents: read |
.github/workflows/sync_copilot.yml
Outdated
| ref: ${{ inputs.calling_repo_base_branch }} | ||
| fetch-depth: 0 | ||
|
|
||
| - name: Checkout code |
There was a problem hiding this comment.
Both checkout steps are named "Checkout code", which makes logs harder to read when debugging. Rename one step to indicate it's checking out NHSDigital/eps-common-workflows (or similar) so it's clear which repo each step refers to.
| - name: Checkout code | |
| - name: Checkout eps-common-workflows repository |
|



Summary
Details