Skip to content

Commit 025e926

Browse files
mcmeroCopilot
andcommitted
fix: case-insensitive repo name check in branch protection workflow
The bash [[ == ]] comparison hardcoded lowercase wehi-soda-hub/sp_segment while the real repo is WEHI-SODA-Hub/sp_segment. That mismatch failed the check for every legitimate dev->main PR, even though the surrounding if: guard (which uses GitHub Actions' case-insensitive ==) let the step run. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 8b24210 commit 025e926

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

‎.github/workflows/branch.yml‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ jobs:
1313
- name: Check PRs
1414
if: github.repository == 'wehi-soda-hub/sp_segment'
1515
run: |
16-
{ [[ ${{github.event.pull_request.head.repo.full_name }} == wehi-soda-hub/sp_segment ]] && [[ $GITHUB_HEAD_REF == "dev" ]]; } || [[ $GITHUB_HEAD_REF == "patch" ]]
16+
HEAD_REPO="${{ github.event.pull_request.head.repo.full_name }}"
17+
{ [[ "${HEAD_REPO,,}" == "wehi-soda-hub/sp_segment" ]] && [[ "$GITHUB_HEAD_REF" == "dev" ]]; } || [[ "$GITHUB_HEAD_REF" == "patch" ]]
1718
1819
# If the above check failed, post a comment on the PR explaining the failure
1920
# NOTE - this doesn't currently work if the PR is coming from a fork, due to limitations in GitHub actions secrets

0 commit comments

Comments
 (0)