We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 6183374 commit d1cb6f8Copy full SHA for d1cb6f8
1 file changed
.github/workflows/badges.yml
@@ -0,0 +1,22 @@
1
+# This workflow will build a golang project
2
+# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go
3
+
4
+name: Prevent merging `badges` branch
5
6
+on:
7
+ pull_request:
8
+ branches: [ "main" ]
9
10
+jobs:
11
+ check_source_branch:
12
+ runs-on: ubuntu-latest
13
+ steps:
14
+ - name: Ensure source branch is not badges
15
+ run: |
16
+ SOURCE_BRANCH="${{ github.head_ref }}"
17
+ RESTRICTED_BRANCH="badges"
18
19
+ if [ "$SOURCE_BRANCH" == "$RESTRICTED_BRANCH" ]; then
20
+ echo "Error: Merging from '$RESTRICTED_BRANCH' into 'main' is not allowed."
21
+ exit 1
22
+ fi
0 commit comments