Skip to content

Commit cf6886c

Browse files
only main allowed
1 parent 56d6d26 commit cf6886c

File tree

5 files changed

+30
-0
lines changed

5 files changed

+30
-0
lines changed

.github/workflows/cd-release-dmg.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,12 @@ jobs:
1919
name: Build Mac release version
2020
runs-on: macos-14
2121
steps:
22+
- name: Validate branch
23+
if: ${{ github.ref_name != 'main' }}
24+
run: |
25+
echo "This workflow can only run from 'main' (got '${{ github.ref_name }}')." >&2
26+
exit 1
27+
2228
- name: Checkout code
2329
uses: actions/checkout@v3
2430

.github/workflows/cd-release-linux.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,12 @@ jobs:
1919
name: Build Linux release version
2020
runs-on: ubuntu-22.04
2121
steps:
22+
- name: Validate branch
23+
if: ${{ github.ref_name != 'main' }}
24+
run: |
25+
echo "This workflow can only run from 'main' (got '${{ github.ref_name }}')." >&2
26+
exit 1
27+
2228
- name: Checkout code
2329
uses: actions/checkout@v3
2430

.github/workflows/cd-release-mas.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,12 @@ jobs:
1919
name: Build Mac App Store release version
2020
runs-on: macos-14
2121
steps:
22+
- name: Validate branch
23+
if: ${{ github.ref_name != 'main' }}
24+
run: |
25+
echo "This workflow can only run from 'main' (got '${{ github.ref_name }}')." >&2
26+
exit 1
27+
2228
- name: Checkout code
2329
uses: actions/checkout@v3
2430

.github/workflows/cd-release-windows.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,12 @@ jobs:
1919
name: Build Windows release version
2020
runs-on: windows-2022
2121
steps:
22+
- name: Validate branch
23+
if: ${{ github.ref_name != 'main' }}
24+
run: |
25+
echo "This workflow can only run from 'main' (got '${{ github.ref_name }}')." >&2
26+
exit 1
27+
2228
- name: Checkout code
2329
uses: actions/checkout@v3
2430

.github/workflows/cd-release.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,12 @@ jobs:
3131
release_id: ${{ steps.create_release.outputs.id }}
3232
release_version: ${{ needs.format-version.outputs.version }}
3333
steps:
34+
- name: Validate branch
35+
if: ${{ github.ref_name != 'main' }}
36+
run: |
37+
echo "This workflow can only run from 'main' (got '${{ github.ref_name }}')." >&2
38+
exit 1
39+
3440
- name: Checkout code
3541
uses: actions/checkout@v3
3642

0 commit comments

Comments
 (0)