Skip to content

Commit a18a8e5

Browse files
committed
sync copilot
1 parent cf14cc5 commit a18a8e5

2 files changed

Lines changed: 28 additions & 1 deletion

File tree

.github/workflows/sync_copilot.yml

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,16 @@ on:
88
required: false
99
default: "main"
1010
type: string
11+
base_branch:
12+
description: "The base branch for the pull request"
13+
required: false
14+
type: string
15+
default: main
16+
secrets:
17+
CREATE_PULL_REQUEST_APP_ID:
18+
required: true
19+
CREATE_PULL_REQUEST_PEM:
20+
required: true
1121

1222
jobs:
1323
sync:
@@ -36,16 +46,24 @@ jobs:
3646
rm -rf tmp
3747
env:
3848
BRANCH_NAME: ${{ inputs.ref }}
49+
- name: Create GitHub App Token
50+
uses: actions/create-github-app-token@f8d387b68d61c58ab83c6c016672934102569859
51+
id: generate-token
52+
with:
53+
app-id: "${{ secrets.CREATE_PULL_REQUEST_APP_ID }}"
54+
private-key: "${{ secrets.CREATE_PULL_REQUEST_PEM }}"
3955

40-
- name: Create PR
56+
- name: Create Pull Request
4157
uses: peter-evans/create-pull-request@c0f553fe549906ede9cf27b5156039d195d2ece0
4258
with:
59+
token: "${{ steps.generate-token.outputs.token }}"
4360
commit-message: "Upgrade: [dependabot] - sync Copilot instructions"
4461
title: "Upgrade: [dependabot] - sync Copilot instructions"
4562
body: |
4663
Syncing Copilot instructions from central repo.
4764
Ref: `${{ inputs.ref }}`
4865
branch: copilot-instructions-sync
66+
base: ${{ inputs.base_branch }}
4967
branch-suffix: random
5068
sign-commits: true
5169
delete-branch: true

README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,12 @@ This workflow syncs Copilot instructions from this repo into another repo and op
115115
#### Inputs
116116
117117
- `ref`: Branch in this repo to sync from. Default: `main`
118+
- `base_branch`: Target branch for the pull request. Default: `main`.
119+
120+
#### Secret Inputs
121+
122+
- `CREATE_PULL_REQUEST_APP_ID`: GitHub App ID used to generate an installation token.
123+
- `CREATE_PULL_REQUEST_PEM`: GitHub App private key used to generate an installation token.
118124

119125
#### Example
120126

@@ -134,6 +140,9 @@ jobs:
134140
uses: NHSDigital/eps-common-workflows/.github/workflows/sync_copilot.yml@f5c8313a10855d0cc911db6a9cd666494c00045a
135141
with:
136142
ref: ${{ github.event.inputs.ref }}
143+
secrets:
144+
CREATE_PULL_REQUEST_APP_ID: ${{ secrets.CREATE_PULL_REQUEST_APP_ID }}
145+
CREATE_PULL_REQUEST_PEM: ${{ secrets.CREATE_PULL_REQUEST_PEM }}
137146
```
138147
```
139148
## PR Title Check

0 commit comments

Comments
 (0)