Skip to content

Commit

Permalink
ail buid if tag already exist
Browse files Browse the repository at this point in the history
  • Loading branch information
dchristl committed Jan 15, 2024
1 parent 2c4ee0c commit ef1ca96
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,16 @@ jobs:
runs-on: ubuntu-latest

steps:
- name: Fail if Git-Tag already exist on main
if: github.ref == 'refs/heads/main'
run: |
TAG="v${{ env.VERSION }}"
if git show-ref --tags --verify --quiet "refs/tags/${TAG}" ]]; then
echo "Tag ${TAG} already exists"
exit 1
else
echo "Tag ${TAG} does not exist"
fi
- name: Remove old artifacts
uses: c-hive/gha-remove-artifacts@v1
with:
Expand Down Expand Up @@ -134,12 +144,10 @@ jobs:
firmware/ESP32/.pio/build/esp32dev/partitions.bin
firmware/ESP32/.pio/build/esp32dev/bootloader.bin
- name: Delete old drafts
if: github.ref == 'refs/heads/main'
uses: hugo19941994/delete-draft-releases@v1.0.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Create Release
if: github.ref == 'refs/heads/main'
uses: "marvinpinto/action-automatic-releases@latest"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
Expand Down

0 comments on commit ef1ca96

Please sign in to comment.