File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -43,11 +43,27 @@ jobs:
4343 clean : ' true'
4444 fetch-depth : 2
4545
46+ - name : Resolve shared workflow ref
47+ run : |
48+ set -euo pipefail
49+ SHARED_WORKFLOW_REF=$(grep -roh \
50+ 'transitdata-shared-workflows/.github/workflows/[^@]*@[^ "'\'']*' \
51+ "${GITHUB_WORKSPACE}/.github/workflows/" 2>/dev/null \
52+ | sed 's/.*@//' | head -1 || true)
53+
54+ if [[ -z "${SHARED_WORKFLOW_REF}" ]]; then
55+ echo "::warning::Could not detect shared workflow ref from caller workflows; falling back to main"
56+ SHARED_WORKFLOW_REF="main"
57+ fi
58+
59+ echo "Resolved shared workflow ref: ${SHARED_WORKFLOW_REF}"
60+ echo "SHARED_WORKFLOW_REF=${SHARED_WORKFLOW_REF}" >> "$GITHUB_ENV"
61+
4662 - name : Checkout shared workflow scripts
4763 uses : actions/checkout@v4
4864 with :
4965 repository : HSLdevcom/transitdata-shared-workflows
50- ref : ${{ github.workflow_sha }}
66+ ref : ${{ env.SHARED_WORKFLOW_REF }}
5167 path : .shared-workflows
5268
5369 - name : Setup JDK
You can’t perform that action at this time.
0 commit comments