From 0147e7f010c6fd7107918162a97fc737ef30802b Mon Sep 17 00:00:00 2001 From: aidenvaines-bjss Date: Mon, 9 Sep 2024 14:01:45 +0100 Subject: [PATCH 1/6] CCM-6405 fix script path --- .github/workflows/scheduled-repository-template-sync.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/scheduled-repository-template-sync.yaml b/.github/workflows/scheduled-repository-template-sync.yaml index 5b3cd1f..5adc80a 100644 --- a/.github/workflows/scheduled-repository-template-sync.yaml +++ b/.github/workflows/scheduled-repository-template-sync.yaml @@ -26,7 +26,7 @@ jobs: - name: Run syncronisation script run: | - /scripts/githooks/sync-template-repo.sh + ./scripts/githooks/sync-template-repo.sh - name: Create Pull Request uses: peter-evans/create-pull-request@v7.0.1 From a960702636e1235846ec18bf50178a7c41f1d602 Mon Sep 17 00:00:00 2001 From: aidenvaines-bjss Date: Mon, 9 Sep 2024 14:15:12 +0100 Subject: [PATCH 2/6] CCM-6405 fix script repo checkout --- .github/workflows/scheduled-repository-template-sync.yaml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/scheduled-repository-template-sync.yaml b/.github/workflows/scheduled-repository-template-sync.yaml index 5adc80a..920a6ad 100644 --- a/.github/workflows/scheduled-repository-template-sync.yaml +++ b/.github/workflows/scheduled-repository-template-sync.yaml @@ -16,16 +16,18 @@ jobs: steps: - name: Check out the repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Check out external repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: - repository: nhsdigital/nhs-notify-repository-template + repository: NHSDigital/nhs-notify-repository-template path: nhs-notify-repository-template + token: ${{ github.token }} - name: Run syncronisation script run: | + ls -la nhs-notify-repository-template/ ./scripts/githooks/sync-template-repo.sh - name: Create Pull Request From 62382de53f7e074c1e789b84a78b6863c7c14a9f Mon Sep 17 00:00:00 2001 From: aidenvaines-bjss Date: Mon, 9 Sep 2024 14:24:35 +0100 Subject: [PATCH 3/6] CCM-6405 fix script repo checkout --- .github/workflows/scheduled-repository-template-sync.yaml | 1 + scripts/config/.repository-template-sync-ignore | 1 + 2 files changed, 2 insertions(+) diff --git a/.github/workflows/scheduled-repository-template-sync.yaml b/.github/workflows/scheduled-repository-template-sync.yaml index 920a6ad..7eea6e6 100644 --- a/.github/workflows/scheduled-repository-template-sync.yaml +++ b/.github/workflows/scheduled-repository-template-sync.yaml @@ -27,6 +27,7 @@ jobs: - name: Run syncronisation script run: | + set -x ls -la nhs-notify-repository-template/ ./scripts/githooks/sync-template-repo.sh diff --git a/scripts/config/.repository-template-sync-ignore b/scripts/config/.repository-template-sync-ignore index 009adf1..9cc4a33 100644 --- a/scripts/config/.repository-template-sync-ignore +++ b/scripts/config/.repository-template-sync-ignore @@ -1,5 +1,6 @@ # Files and folders to ignore when syncing nhs-notify-repository-template back in to this repository scripts/config/.repository-template-sync-ignore +nhs-notify-repository-template # Files and Folders in this repository to ignore .vscode/ From 5384c8945d549f915f3602f8633c79a3243cb1b9 Mon Sep 17 00:00:00 2001 From: aidenvaines-bjss Date: Mon, 9 Sep 2024 14:52:14 +0100 Subject: [PATCH 4/6] CCM-6405 fix script repo checkout --- .../scheduled-repository-template-sync.yaml | 12 ++++-------- scripts/githooks/sync-template-repo.sh | 2 +- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/.github/workflows/scheduled-repository-template-sync.yaml b/.github/workflows/scheduled-repository-template-sync.yaml index 7eea6e6..a227476 100644 --- a/.github/workflows/scheduled-repository-template-sync.yaml +++ b/.github/workflows/scheduled-repository-template-sync.yaml @@ -27,11 +27,10 @@ jobs: - name: Run syncronisation script run: | - set -x - ls -la nhs-notify-repository-template/ ./scripts/githooks/sync-template-repo.sh - name: Create Pull Request + if: ${{ !env.ACT }} uses: peter-evans/create-pull-request@v7.0.1 with: token: ${{ secrets.GITHUB_TOKEN }} @@ -43,15 +42,12 @@ jobs: # Resultant drift from repository template ## Who should respond to this PR? - The team which owns the responsibility for the services the repository maintains + The team which owns the responsibility for this component repository. You may want to consult other contributors. ## How to progress this PR - The repositories guardians should review the contents of the PR and decide - how to proceed, you may wish to back-out certain changes or accept them from the upstream - `nhsdigital/nhs-notify-repository-template` repository. + The repositories guardians should review the contents of the PR and decide how to proceed, you may wish to back-out certain changes or accept them from the upstream `nhsdigital/nhs-notify-repository-template` repository. - If there are changes you do not wish to see again, it is recommended you add exclusions to - `scripts/config/.repository-template-sync-ignore` + If there are changes you do not wish to see again, it is recommended you add exclusions to `scripts/config/.repository-template-sync-ignore`. labels: | template automation diff --git a/scripts/githooks/sync-template-repo.sh b/scripts/githooks/sync-template-repo.sh index 994d430..060aaa4 100755 --- a/scripts/githooks/sync-template-repo.sh +++ b/scripts/githooks/sync-template-repo.sh @@ -49,7 +49,7 @@ is_ignored() { fi for ignored in "${IGNORED_PATHS[@]}"; do - if [[ "$file" =~ $ignored ]]; then + if [[ -n "$ignored" && "$file" =~ $ignored ]]; then return 0 fi done From 083b83d063a889e3a5c1c6b2c5e28fafff958f47 Mon Sep 17 00:00:00 2001 From: aidenvaines-bjss Date: Mon, 9 Sep 2024 15:14:24 +0100 Subject: [PATCH 5/6] CCM-6405 fix script repo checkout --- .github/workflows/scheduled-repository-template-sync.yaml | 1 + scripts/config/.repository-template-sync-ignore | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/scheduled-repository-template-sync.yaml b/.github/workflows/scheduled-repository-template-sync.yaml index a227476..570a2cf 100644 --- a/.github/workflows/scheduled-repository-template-sync.yaml +++ b/.github/workflows/scheduled-repository-template-sync.yaml @@ -6,6 +6,7 @@ on: workflow_dispatch: permissions: + actions: write contents: write pull-requests: write checks: read diff --git a/scripts/config/.repository-template-sync-ignore b/scripts/config/.repository-template-sync-ignore index 9cc4a33..2626b4a 100644 --- a/scripts/config/.repository-template-sync-ignore +++ b/scripts/config/.repository-template-sync-ignore @@ -1,6 +1,6 @@ # Files and folders to ignore when syncing nhs-notify-repository-template back in to this repository scripts/config/.repository-template-sync-ignore -nhs-notify-repository-template +nhs-notify-repository-template/ # Files and Folders in this repository to ignore .vscode/ From d54faabd3865b35123a3fe43830cb84a6e7f1a38 Mon Sep 17 00:00:00 2001 From: aidenvaines-bjss Date: Mon, 9 Sep 2024 15:19:16 +0100 Subject: [PATCH 6/6] CCM-6405 fix script repo checkout --- .github/workflows/scheduled-repository-template-sync.yaml | 1 - scripts/config/.repository-template-sync-ignore | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/scheduled-repository-template-sync.yaml b/.github/workflows/scheduled-repository-template-sync.yaml index 570a2cf..a227476 100644 --- a/.github/workflows/scheduled-repository-template-sync.yaml +++ b/.github/workflows/scheduled-repository-template-sync.yaml @@ -6,7 +6,6 @@ on: workflow_dispatch: permissions: - actions: write contents: write pull-requests: write checks: read diff --git a/scripts/config/.repository-template-sync-ignore b/scripts/config/.repository-template-sync-ignore index 2626b4a..7564f3e 100644 --- a/scripts/config/.repository-template-sync-ignore +++ b/scripts/config/.repository-template-sync-ignore @@ -1,5 +1,6 @@ # Files and folders to ignore when syncing nhs-notify-repository-template back in to this repository scripts/config/.repository-template-sync-ignore +.github/workflows/ nhs-notify-repository-template/ # Files and Folders in this repository to ignore