You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We have a branch name convention which currently is not validated automatically.
Wanted
Configure the pipelines to validate the branch name. Invalid branch names should make the pipeline fail.
Solution
Something like this should do the trick.
jobs:
check-branch-name:
runs-on: ubuntu-latest
steps:
- name: Check branch name
run: |
BRANCH_NAME=${GITHUB_REF#refs/heads/}
if [[ ! "$BRANCH_NAME" =~ ^(feature|bugfix|hotfix)/.+$ ]]; then
echo "Branch name '$BRANCH_NAME' does not match the required pattern."
exit 1
fi
It might be desirable to put this into a blueprint which can be used across all GitHub workflows.
The text was updated successfully, but these errors were encountered:
Situation
We have a branch name convention which currently is not validated automatically.
Wanted
Configure the pipelines to validate the branch name. Invalid branch names should make the pipeline fail.
Solution
Something like this should do the trick.
It might be desirable to put this into a blueprint which can be used across all GitHub workflows.
The text was updated successfully, but these errors were encountered: