Skip to content

Commit 5bdf60b

Browse files
committed
eja - adding repo param to checkout
1 parent 9d239ca commit 5bdf60b

1 file changed

Lines changed: 2 additions & 27 deletions

File tree

.github/workflows/regression_tests.yml

Lines changed: 2 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -67,32 +67,6 @@ jobs:
6767
runs-on: ubuntu-22.04
6868
environment: ${{ inputs.environment }}
6969
steps:
70-
- name: Verify caller repository
71-
run: |
72-
ALLOWED_REPOS=("NHSDigital/eligibility-signposting-api")
73-
CALLER_REPO="${{ github.repository }}"
74-
75-
# If triggered by workflow_call, the calling repo is in github.repository
76-
# If triggered manually, it's this repo itself which is allowed
77-
if [[ "${{ github.event_name }}" == "workflow_call" ]]; then
78-
CALLER_REPO="${{ github.event.workflow_run.repository.full_name || github.repository }}"
79-
fi
80-
81-
ALLOWED=false
82-
for repo in "${ALLOWED_REPOS[@]}"; do
83-
if [[ "$CALLER_REPO" == "$repo" ]]; then
84-
ALLOWED=true
85-
break
86-
fi
87-
done
88-
89-
if [[ "$ALLOWED" == "false" && "${{ github.event_name }}" == "workflow_call" ]]; then
90-
echo "Error: Repository $CALLER_REPO is not allowed to trigger this workflow"
91-
exit 1
92-
fi
93-
94-
echo "Workflow triggered by allowed repository: $CALLER_REPO"
95-
9670
- name: show_input_parameters
9771
env:
9872
tags: ${{ inputs.tags }}
@@ -123,8 +97,9 @@ jobs:
12397
echo run identifier "$ID"-"$ENV" >> "$GITHUB_STEP_SUMMARY"
12498
12599
- name: Checkout
126-
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5
100+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
127101
with:
102+
repository: NHSDigital/eligibility-signposting-api-regression-tests
128103
ref: ${{ inputs.github_tag }}
129104

130105
# using git commit sha for version of action to ensure we have stable version

0 commit comments

Comments
 (0)