Skip to content

Commit

Permalink
build: Use delete tag on flow if changelog is empty
Browse files Browse the repository at this point in the history
  • Loading branch information
pionl committed Sep 23, 2022
1 parent 66c25a9 commit 6d59fb6
Showing 1 changed file with 12 additions and 16 deletions.
28 changes: 12 additions & 16 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,29 +15,14 @@ jobs:
deploy:
needs:
- check
name: Create release
name: Create release if changelog has changes
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v2
with:
fetch-depth: '0'

- name: Create local tag for building changelog
run: |
git tag -f main-latest
git push --follow-tags
- name: Try to update CHANGELOG
id: changelog
uses: Requarks/changelog-action@v1
with:
token: ${{ github.token }}
tag: main-latest

- name: Remove tag
run: git tag -d main-latest

- name: Bump version and push tag
if: steps.changelog.outputs.changes != ''
uses: anothrNick/[email protected]
Expand All @@ -49,6 +34,13 @@ jobs:
INITIAL_VERSION: 0.0.1
TAG_CONTEXT: branch

- name: Try to update CHANGELOG
id: changelog
uses: Requarks/changelog-action@v1
with:
token: ${{ github.token }}
tag: ${{ steps.version.outputs.new_tag }}

- name: Create Release
if: steps.changelog.outputs.changes != ''
uses: ncipollo/release-action@v1
Expand All @@ -68,6 +60,10 @@ jobs:
commit_message: 'docs: update CHANGELOG.md for ${{ github.ref_name }} [skip ci]'
file_pattern: CHANGELOG.md

- name: Remove tag
if: steps.changelog.outputs.changes == ''
run: git tag -d ${{ steps.version.outputs.new_tag }}

documentation:
name: Deploy documentation
needs:
Expand Down

0 comments on commit 6d59fb6

Please sign in to comment.