Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 24 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,32 @@ concurrency:
cancel-in-progress: false

jobs:
release:
# Skip automated version bump commits
check:
# Skip automated version bump commits and stale push events for an already tagged main.
if: "!contains(github.event.head_commit.message, 'chore: release')"
runs-on: ubuntu-latest
outputs:
needed: ${{ steps.unreleased.outputs.needed }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Check whether main is already released
id: unreleased
run: |
git fetch origin main --tags
if git describe --tags --exact-match --match 'v[0-9]*' origin/main >/dev/null 2>&1; then
echo "needed=false" >> "$GITHUB_OUTPUT"
echo "Current main already has a version tag; no release needed"
else
echo "needed=true" >> "$GITHUB_OUTPUT"
fi

release:
needs: check
if: needs.check.outputs.needed == 'true'
runs-on: ubuntu-latest
permissions:
contents: write
id-token: write
Expand Down
Loading