Skip to content

Commit 0ea810b

Browse files
committed
Prevent build failure on multiple main commits
1 parent b660a7a commit 0ea810b

1 file changed

Lines changed: 19 additions & 0 deletions

File tree

.github/workflows/build.yaml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,25 @@ on:
77
- main
88

99
jobs:
10+
check-tag:
11+
runs-on: ubuntu-latest
12+
name: Check for tag
13+
steps:
14+
- name: Checkout
15+
uses: actions/checkout@v4
16+
- name: Load Version
17+
run: |
18+
echo RELEASE_VERSION=$(cat ./version.txt) >> $GITHUB_ENV
19+
- name: Check for Tag
20+
run: |
21+
if git show-ref --tags --verify --quiet "refs/tags/${RELEASE_VERSION}"; then
22+
echo TAG_EXISTS=true >> $GITHUB_ENV
23+
else
24+
echo TAG_EXISTS=false >> $GITHUB_ENV
25+
fi
26+
1027
build:
28+
if: ${{ env.TAG_EXISTS == 'false' }}
1129
strategy:
1230
matrix:
1331
rid:
@@ -50,6 +68,7 @@ jobs:
5068
/home/runner/work/CovertActionTools/CovertActionTools/dist
5169
if-no-files-found: error
5270
release:
71+
if: ${{ env.TAG_EXISTS == 'false' }}
5372
needs: build
5473
runs-on: ubuntu-latest
5574
name: Create Release

0 commit comments

Comments
 (0)