@@ -3,13 +3,13 @@ name: Sync copilot instructions
33on :
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
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
0 commit comments