Skip to content

Commit

Permalink
fix ci attempt 2
Browse files Browse the repository at this point in the history
  • Loading branch information
vamsii777 committed Nov 21, 2024
1 parent df0252f commit 7e4ac03
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
name: Create Release
name: Release

on:
pull_request:
types: [closed]
branches:
- main

permissions:
contents: write
pull-requests: write
issues: write

jobs:
create-release:
name: Create Release
Expand All @@ -21,8 +26,10 @@ jobs:
with:
fetch-depth: 0

- name: Determine Next Version
- name: Determine Version
id: version
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
# Get latest release tag (if any)
latest_tag=$(gh release view --json tagName --jq .tagName || echo "v0.0.0")
Expand All @@ -39,11 +46,12 @@ jobs:
fi
# Determine version bump type from PR labels
if contains(github.event.pull_request.labels.*.name, 'major'); then
labels="${{ toJSON(github.event.pull_request.labels.*.name) }}"
if echo "$labels" | jq -e 'contains(["major"])' > /dev/null; then
major=$((major + 1))
minor=0
patch=0
elif contains(github.event.pull_request.labels.*.name, 'minor'); then
elif echo "$labels" | jq -e 'contains(["minor"])' > /dev/null; then
minor=$((minor + 1))
patch=0
else
Expand All @@ -54,8 +62,6 @@ jobs:
new_version="v${major}.${minor}.${patch}"
echo "New version will be: $new_version"
echo "version=$new_version" >> $GITHUB_OUTPUT
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Generate Release Notes
id: release-notes
Expand Down

0 comments on commit 7e4ac03

Please sign in to comment.