Skip to content

Chore: [AEA-0000] - workflow to sync copilot instructions#62

Open
anthony-nhs wants to merge 29 commits intomainfrom
copilot
Open

Chore: [AEA-0000] - workflow to sync copilot instructions#62
anthony-nhs wants to merge 29 commits intomainfrom
copilot

Conversation

@anthony-nhs
Copy link
Copy Markdown
Contributor

@anthony-nhs anthony-nhs commented Feb 11, 2026

Summary

  • Routine Change

Details

  • workflow to sync copilot instructions
  • add copilot instructions to sync to each repo

@github-actions
Copy link
Copy Markdown
Contributor

This PR is linked to a ticket in an NHS Digital JIRA Project. Here's a handy link to the ticket:

AEA-0000

@sonarqubecloud
Copy link
Copy Markdown

@anthony-nhs anthony-nhs enabled auto-merge (squash) February 24, 2026 09:45
Copilot AI review requested due to automatic review settings March 27, 2026 14:55
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.yml to fetch instruction assets from the central repo and open a PR with updates.
  • Add Copilot instruction assets under .github/instructions/**, plus .github/copilot-instructions.md and 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.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment on lines +73 to +74
commit-message: "Upgrade: [dependabot] - sync Copilot instructions"
title: "Upgrade: [dependabot] - sync Copilot instructions"
Copy link

Copilot AI Mar 30, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
commit-message: "Upgrade: [dependabot] - sync Copilot instructions"
title: "Upgrade: [dependabot] - sync Copilot instructions"
commit-message: "Upgrade: sync Copilot instructions"
title: "Upgrade: sync Copilot instructions"

Copilot uses AI. Check for mistakes.
@@ -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'
Copy link

Copilot AI Mar 30, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
applyTo: '**/*.ts, **/*.tsx'
applyTo: '**/*.{ts,tsx}'

Copilot uses AI. Check for mistakes.
@@ -0,0 +1,18 @@
# EPS Common Workflow - copilot instructions
Copy link

Copilot AI Mar 30, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the heading, "copilot" should be capitalized as "Copilot" for consistency with GitHub naming.

Suggested change
# EPS Common Workflow - copilot instructions
# EPS Common Workflow - Copilot instructions

Copilot uses AI. Check for mistakes.
# EPS Common Workflow - copilot instructions

## Overview
This contains common github workflows that are used by other EPS projects
Copy link

Copilot AI Mar 30, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"github" should be capitalized as "GitHub" (brand name) since this file is intended for broad reuse.

Copilot uses AI. Check for mistakes.
## 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
Copy link

Copilot AI Mar 30, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider writing "Git commit SHA" (or "commit SHA") instead of "git commit sha" for consistent capitalization of the tool name and acronym.

Suggested change
*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

Copilot uses AI. Check for mistakes.
Comment on lines +190 to +191
9. **Build Methods**: Use esbuild for Node.js Lambda functions
10. **Version Pinning**: Pin Lambda layer versions and runtimes
Copy link

Copilot AI Mar 30, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
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

Copilot uses AI. Check for mistakes.
### Standard Parameters
Always include these common parameters in templates:
```yaml
Parameters
Copy link

Copilot AI Mar 30, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
Parameters
Parameters:

Copilot uses AI. Check for mistakes.
Comment on lines +26 to +27
contents: write
pull-requests: write
Copy link

Copilot AI Mar 30, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

Suggested change
contents: write
pull-requests: write
contents: read

Copilot uses AI. Check for mistakes.
ref: ${{ inputs.calling_repo_base_branch }}
fetch-depth: 0

- name: Checkout code
Copy link

Copilot AI Mar 30, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
- name: Checkout code
- name: Checkout eps-common-workflows repository

Copilot uses AI. Check for mistakes.
connoravo-nhs
connoravo-nhs previously approved these changes Mar 30, 2026
@sonarqubecloud
Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants