Skip to content

Commit b75ba03

Browse files
committed
update
1 parent a18a8e5 commit b75ba03

3 files changed

Lines changed: 92 additions & 24 deletions

File tree

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
---
2+
description: "Perform a comprehensive code review"
3+
---
4+
5+
## Role
6+
7+
You're a senior software engineer conducting a thorough code review. Provide constructive, actionable feedback.
8+
9+
## Review Areas
10+
11+
Analyze the selected code for:
12+
13+
1. **Security Issues**
14+
- Input validation and sanitization
15+
- Authentication and authorization
16+
- Data exposure risks
17+
- Injection vulnerabilities
18+
19+
2. **Performance & Efficiency**
20+
- Algorithm complexity
21+
- Memory usage patterns
22+
- Database query optimization
23+
- Unnecessary computations
24+
25+
3. **Code Quality**
26+
- Readability and maintainability
27+
- Proper naming conventions
28+
- Function/class size and responsibility
29+
- Code duplication
30+
31+
4. **Architecture & Design**
32+
- Design pattern usage
33+
- Separation of concerns
34+
- Dependency management
35+
- Error handling strategy
36+
37+
5. **Testing & Documentation**
38+
- Test coverage and quality
39+
- Documentation completeness
40+
- Comment clarity and necessity
41+
42+
## Output Format
43+
44+
Provide feedback as:
45+
46+
**🔴 Critical Issues** - Must fix before merge
47+
**🟡 Suggestions** - Improvements to consider
48+
**✅ Good Practices** - What's done well
49+
50+
For each issue:
51+
52+
- Specific line references
53+
- Clear explanation of the problem
54+
- Suggested solution with code example
55+
- Rationale for the change
56+
57+
Focus on: ${input:focus:Any specific areas to emphasize in the review?}
58+
59+
Be constructive and educational in your feedback.

.github/workflows/sync_copilot.yml

Lines changed: 27 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@ name: Sync copilot instructions
33
on:
44
workflow_call:
55
inputs:
6-
ref:
7-
description: "The branch to sync from the central repository"
6+
common_workflows_ref:
7+
description: "The ref to sync from the central repository"
88
required: false
99
default: "main"
1010
type: string
11-
base_branch:
12-
description: "The base branch for the pull request"
11+
calling_repo_base_branch:
12+
description: "The base branch from the calling repository for"
1313
required: false
1414
type: string
1515
default: main
@@ -30,22 +30,30 @@ jobs:
3030
- name: Checkout code
3131
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
3232
with:
33-
ref: ${{ env.BRANCH_NAME }}
33+
ref: ${{ inputs.calling_repo_base_branch }}
3434
fetch-depth: 0
3535

36-
- name: Fetch central instructions
36+
- name: Checkout code
37+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
38+
with:
39+
ref: ${{ inputs.common_workflows_ref }}
40+
fetch-depth: 0
41+
path: eps-common-workflows
42+
repository: NHSDigital/eps-common-workflows
43+
sparse-checkout: |
44+
- .github/instructions
45+
- .github/copilot-instructions.md
46+
- .github/chatmodes
47+
- .github/prompts
48+
49+
- name: Copy central instructions
3750
run: |
38-
rm -rf .github/copilot
39-
git clone \
40-
--depth 1 \
41-
--branch "${BRANCH_NAME}" \
42-
https://github.com/NHSDigital/eps-common-workflows.git tmp
43-
mv tmp/.github/chatmodes .github/chatmodes
44-
mv tmp/.github/instructions .github/instructions
45-
mv tmp/.github/copilot-instructions.md .github/copilot-instructions.md
46-
rm -rf tmp
47-
env:
48-
BRANCH_NAME: ${{ inputs.ref }}
51+
mv eps-common-workflows/.github/chatmodes .github/chatmodes
52+
mv eps-common-workflows/.github/instructions .github/instructions
53+
mv eps-common-workflows/.github/copilot-instructions.md .github/copilot-instructions.md
54+
mv eps-common-workflows/.github/prompts .github/prompts
55+
rm -rf eps-common-workflows
56+
4957
- name: Create GitHub App Token
5058
uses: actions/create-github-app-token@f8d387b68d61c58ab83c6c016672934102569859
5159
id: generate-token
@@ -61,9 +69,9 @@ jobs:
6169
title: "Upgrade: [dependabot] - sync Copilot instructions"
6270
body: |
6371
Syncing Copilot instructions from central repo.
64-
Ref: `${{ inputs.ref }}`
72+
Ref: `${{ inputs.common_workflows_ref }}`
6573
branch: copilot-instructions-sync
66-
base: ${{ inputs.base_branch }}
74+
base: ${{ inputs.calling_repo_base_branch }}
6775
branch-suffix: random
6876
sign-commits: true
6977
delete-branch: true

README.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ The workflows that are available to use are
88

99
- [Combine Dependabot PRs](#combine-dependabot-prs)
1010
- [Dependabot Auto Approve and Merge](#dependabot-auto-approve-and-merge)
11+
- [Sync copilot instructios](#sync-copilot-instructions)
1112
- [PR Title Check](#pr-title-check)
1213
- [Get Repo Config](#get-repo-config)
1314
- [Quality Checks](#quality-checks)
@@ -114,8 +115,8 @@ This workflow syncs Copilot instructions from this repo into another repo and op
114115
115116
#### Inputs
116117
117-
- `ref`: Branch in this repo to sync from. Default: `main`
118-
- `base_branch`: Target branch for the pull request. Default: `main`.
118+
- `common_workflows_ref`: Branch in common workflows repo to sync from. Default: `main`
119+
- `base_branch`: The base branch in the calling repository. Default: `main`.
119120

120121
#### Secret Inputs
121122

@@ -130,21 +131,21 @@ name: Sync Copilot Instructions
130131
on:
131132
workflow_dispatch:
132133
inputs:
133-
ref:
134+
common_workflows_ref:
134135
description: "Branch to sync from"
135136
required: false
136137
type: string
138+
default: main
137139
138140
jobs:
139141
sync-copilot:
140142
uses: NHSDigital/eps-common-workflows/.github/workflows/sync_copilot.yml@f5c8313a10855d0cc911db6a9cd666494c00045a
141143
with:
142-
ref: ${{ github.event.inputs.ref }}
144+
ref: ${{ github.event.inputs.common_workflows_ref }}
143145
secrets:
144146
CREATE_PULL_REQUEST_APP_ID: ${{ secrets.CREATE_PULL_REQUEST_APP_ID }}
145147
CREATE_PULL_REQUEST_PEM: ${{ secrets.CREATE_PULL_REQUEST_PEM }}
146148
```
147-
```
148149
## PR Title Check
149150
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.
150151

0 commit comments

Comments
 (0)