Skip to content

Commit e9e628d

Browse files
committed
fix(ci): Relax branch-name lint to allow prefixes
fix(ci): capture branch name for push events
1 parent 1262810 commit e9e628d

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

.github/workflows/tidy3d-python-client-tests.yml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,10 @@ jobs:
216216
id: extract-branch-name
217217
run: |
218218
BRANCH_NAME="${GITHUB_HEAD_REF}"
219+
if [[ -z "$BRANCH_NAME" ]]; then
220+
BRANCH_NAME="${GITHUB_REF_NAME:-${GITHUB_REF#refs/heads/}}"
221+
echo "(fallback) Using ref-derived branch name: $BRANCH_NAME"
222+
fi
219223
echo "Branch name: $BRANCH_NAME"
220224
echo "branch_name=$BRANCH_NAME" >> $GITHUB_OUTPUT
221225
@@ -226,7 +230,10 @@ jobs:
226230
run: |
227231
BRANCH_NAME="${STEPS_EXTRACT_BRANCH_NAME_OUTPUTS_BRANCH_NAME}"
228232
echo $BRANCH_NAME
229-
JIRA_PATTERN='[A-Z]{2,}-[0-9]+'
233+
# Allow only Jira keys from known projects, even if the branch has an author prefix
234+
ALLOWED_JIRA_PROJECTS=("FXC" "SCEM")
235+
JIRA_PROJECT_PATTERN=$(IFS='|'; echo "${ALLOWED_JIRA_PROJECTS[*]}")
236+
JIRA_PATTERN="(${JIRA_PROJECT_PATTERN})-[0-9]+"
230237
231238
# List of exempt prefixes (case-insensitive)
232239
EXEMPT_PREFIXES=("chore" "hotfix" "daily-chore")
@@ -250,6 +257,7 @@ jobs:
250257
echo "✅ Jira key found in PR-title: ${BASH_REMATCH[0]}"
251258
else
252259
echo "❌ No Jira key found in branch name and PR title"
260+
echo "ℹ️ Expected Jira key prefixes: ${ALLOWED_JIRA_PROJECTS[*]}"
253261
exit 1
254262
fi
255263
fi
@@ -684,4 +692,3 @@ jobs:
684692
- name: all-checks-passed
685693
if: ${{ success() }}
686694
run: echo "✅ All required jobs passed!"
687-

0 commit comments

Comments
 (0)