We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 495d854 commit 83f8fd1Copy full SHA for 83f8fd1
.github/workflows/check-branch-name.yml
@@ -0,0 +1,24 @@
1
+name: Check branch name
2
+
3
+on:
4
+ push:
5
+ branches-ignore:
6
+ - 'master' # ignore the 'master' branch
7
+ - 'main' # ignore the 'main' branch
8
9
+jobs:
10
+ check-branch-name:
11
+ runs-on: ubuntu-latest
12
+ steps:
13
+ - name: Checkout code
14
+ uses: actions/checkout@v2
15
+ with:
16
+ fetch-depth: 2 # this is important, as the default is to only fetch the most recent commit
17
18
+ - name: Check branch name
19
+ run: |
20
+ commit_message=$(git log --format=%B -n 1 ${{ github.sha }})
21
+ if [[ "${commit_message}" != "Apply fixes from StyleCI" && ! "${{ github.ref_name }}" =~ ^[0-9]{4}- ]]; then
22
+ echo "ERROR: Branch name '${{ github.ref_name }}' does not start with a valid issue number!"
23
+ exit 1
24
+ fi
0 commit comments