diff --git a/.github/workflows/scheduled-repository-template-sync.yaml b/.github/workflows/scheduled-repository-template-sync.yaml index 5b3cd1f..a227476 100644 --- a/.github/workflows/scheduled-repository-template-sync.yaml +++ b/.github/workflows/scheduled-repository-template-sync.yaml @@ -16,19 +16,21 @@ 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: | - /scripts/githooks/sync-template-repo.sh + ./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 }} @@ -40,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/config/.repository-template-sync-ignore b/scripts/config/.repository-template-sync-ignore index 009adf1..7564f3e 100644 --- a/scripts/config/.repository-template-sync-ignore +++ b/scripts/config/.repository-template-sync-ignore @@ -1,5 +1,7 @@ # 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 .vscode/ 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