Skip to content
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion .github/workflows/release-changelog-internal.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
uses: ./.github/workflows/release-changelog.yml
with:
branch: 'master'
tag_format: X.Y.Z
tag_format: vX.Y.Z
release_tag: ${{ github.ref_name }}
secrets:
GITHUB: ${{ secrets.GITHUB }}
Expand Down
17 changes: 1 addition & 16 deletions .github/workflows/release-changelog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,6 @@ on:
required: true
type: string
description: "Actual release tag to validate and use"
version_type:
required: true
type: string
description: "Type of release (major/minor/patch)"
latest_tag:
required: true
type: string
description: "Previous tag for comparison"

secrets:
GITHUB:
Expand Down Expand Up @@ -108,14 +100,7 @@ jobs:
allowUpdates: true
draft: false
makeLatest: true
body: |
${{ steps.changelog.outputs.changes }}

**Release Type:** ${{ inputs.version_type }}

${{ inputs.version_type == 'major' && '⚠️ **BREAKING CHANGES:** This is a major release with breaking changes. Please review the breaking changes section in [CHANGELOG.md](https://github.com/${{ github.repository }}/blob/${{ inputs.release_tag }}/CHANGELOG.md) before upgrading.' || '' }}

[Compare changes](https://github.com/${{ github.repository }}/compare/${{ inputs.latest_tag }}...${{ inputs.release_tag }})
body: ${{ steps.changelog.outputs.changes }}

- name: πŸ’Ύ Commit CHANGELOG.md
uses: stefanzweifel/git-auto-commit-action@v7
Expand Down
27 changes: 20 additions & 7 deletions .github/workflows/release-tag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ on:
type: boolean
default: true
description: "Whether to create changelog and release (default: true)"
latest_tag:
required: false
type: string
description: "Previous tag for comparison (optional - will be auto-detected if not provided)"

secrets:
GITHUB:
required: true
Expand Down Expand Up @@ -67,14 +72,24 @@ jobs:
echo "reason=no valid label found, skipping" >> $GITHUB_OUTPUT
fi

- name: πŸ”– Get latest tag (or 1.0.0 if none)
- name: πŸ”– Get latest tag (or use provided latest_tag or default to 1.0.0)
id: get_latest_tag
if: steps.skip_tag.outputs.skip == 'false'
run: |
git fetch --tags
LATEST_TAG=$(git tag --list --sort=-v:refname | head -n 1)
if [ -z "$LATEST_TAG" ]; then
LATEST_TAG="1.0.0"
# First, check if latest_tag was provided as input
if [ -n "${{ inputs.latest_tag }}" ]; then
LATEST_TAG="${{ inputs.latest_tag }}"
echo "Using provided latest_tag: $LATEST_TAG"
else
# Otherwise, fetch from git tags
git fetch --tags
LATEST_TAG=$(git tag --list --sort=-v:refname | head -n 1)
if [ -z "$LATEST_TAG" ]; then
LATEST_TAG="1.0.0"
echo "No existing tags found, defaulting to: $LATEST_TAG"
else
echo "Found latest tag from git: $LATEST_TAG"
fi
fi
echo "latest_tag=$LATEST_TAG" >> $GITHUB_OUTPUT

Expand Down Expand Up @@ -137,7 +152,5 @@ jobs:
branch: ${{ inputs.target_branch }}
tag_format: ${{ inputs.tag_format }}
release_tag: ${{ needs.create-tag.outputs.final_tag }}
version_type: ${{ needs.create-tag.outputs.version_type }}
latest_tag: ${{ needs.create-tag.outputs.latest_tag }}
secrets:
GITHUB: ${{ secrets.GITHUB }}
1 change: 1 addition & 0 deletions docs/release-tag.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ jobs:
target_branch: ${{ github.event.pull_request.base.ref }}
tag_format: "vX.Y.Z" # or "X.Y.Z" depending on your preference
# create_changelog: false # πŸ‘ˆ Disable changelog generation
# latest_tag: ${{ github.event.inputs.base_tag }} # "" # πŸ‘ˆ latest_tag is optional - will be auto-detected
secrets:
GITHUB: ${{ secrets.TOKEN_GITHUB }}
```
Loading