ci: remove redundant git fetch for tags in release note generation
This commit is contained in:
parent
1148947b8e
commit
eb4f809435
16
.github/workflows/gitea-release.yml
vendored
16
.github/workflows/gitea-release.yml
vendored
@ -71,14 +71,10 @@ jobs:
|
|||||||
- name: Generate Release Notes
|
- name: Generate Release Notes
|
||||||
id: release_notes
|
id: release_notes
|
||||||
run: |
|
run: |
|
||||||
# Fetch all tags first
|
|
||||||
git fetch --tags
|
|
||||||
|
|
||||||
# Get all tags sorted by version
|
# Get all tags sorted by version
|
||||||
TAGS=($(git tag -l 'v*' --sort=-v:refname))
|
TAGS=($(git tag -l 'v*' --sort=-v:refname))
|
||||||
CURRENT_TAG="${TAGS[0]}"
|
CURRENT_TAG="${TAGS[0]}"
|
||||||
|
|
||||||
# Get previous tag (second in list)
|
|
||||||
if [ ${#TAGS[@]} -gt 1 ]; then
|
if [ ${#TAGS[@]} -gt 1 ]; then
|
||||||
PREVIOUS_TAG="${TAGS[1]}"
|
PREVIOUS_TAG="${TAGS[1]}"
|
||||||
echo "CHANGES<<EOF" >> $GITHUB_OUTPUT
|
echo "CHANGES<<EOF" >> $GITHUB_OUTPUT
|
||||||
@ -87,15 +83,15 @@ jobs:
|
|||||||
|
|
||||||
# Get commits between previous and current tag
|
# Get commits between previous and current tag
|
||||||
echo "### Added" >> $GITHUB_OUTPUT
|
echo "### Added" >> $GITHUB_OUTPUT
|
||||||
git log ${PREVIOUS_TAG}..${CURRENT_TAG} --pretty=format:%s | grep -iE '^(feat|add|new)' | sed 's/^feat: /- /' | sort -u >> $GITHUB_OUTPUT || true
|
git log ${PREVIOUS_TAG}..${CURRENT_TAG} --pretty=format:%s | grep -iE '^(feat|add|new)' | sed 's/^feat: /- /' >> $GITHUB_OUTPUT || true
|
||||||
echo "" >> $GITHUB_OUTPUT
|
echo "" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
echo "### Fixed" >> $GITHUB_OUTPUT
|
echo "### Fixed" >> $GITHUB_OUTPUT
|
||||||
git log ${PREVIOUS_TAG}..${CURRENT_TAG} --pretty=format:%s | grep -iE '^fix' | sed 's/^fix: /- /' | sort -u >> $GITHUB_OUTPUT || true
|
git log ${PREVIOUS_TAG}..${CURRENT_TAG} --pretty=format:%s | grep -iE '^fix' | sed 's/^fix: /- /' >> $GITHUB_OUTPUT || true
|
||||||
echo "" >> $GITHUB_OUTPUT
|
echo "" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
echo "### Changed" >> $GITHUB_OUTPUT
|
echo "### Changed" >> $GITHUB_OUTPUT
|
||||||
git log ${PREVIOUS_TAG}..${CURRENT_TAG} --pretty=format:%s | grep -ivE '^(feat|fix|add|new)' | sed 's/^/- /' | sort -u >> $GITHUB_OUTPUT || true
|
git log ${PREVIOUS_TAG}..${CURRENT_TAG} --pretty=format:%s | grep -ivE '^(feat|fix|add|new)' | sed 's/^/- /' >> $GITHUB_OUTPUT || true
|
||||||
echo "EOF" >> $GITHUB_OUTPUT
|
echo "EOF" >> $GITHUB_OUTPUT
|
||||||
else
|
else
|
||||||
# First release or no previous tag
|
# First release or no previous tag
|
||||||
@ -105,15 +101,15 @@ jobs:
|
|||||||
# Add all commits for initial release
|
# Add all commits for initial release
|
||||||
echo "" >> $GITHUB_OUTPUT
|
echo "" >> $GITHUB_OUTPUT
|
||||||
echo "### Added" >> $GITHUB_OUTPUT
|
echo "### Added" >> $GITHUB_OUTPUT
|
||||||
git log --pretty=format:%s | grep -iE '^(feat|add|new)' | sed 's/^feat: /- /' | sort -u >> $GITHUB_OUTPUT || true
|
git log --pretty=format:%s | grep -iE '^(feat|add|new)' | sed 's/^feat: /- /' >> $GITHUB_OUTPUT || true
|
||||||
echo "" >> $GITHUB_OUTPUT
|
echo "" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
echo "### Fixed" >> $GITHUB_OUTPUT
|
echo "### Fixed" >> $GITHUB_OUTPUT
|
||||||
git log --pretty=format:%s | grep -iE '^fix' | sed 's/^fix: /- /' | sort -u >> $GITHUB_OUTPUT || true
|
git log --pretty=format:%s | grep -iE '^fix' | sed 's/^fix: /- /' >> $GITHUB_OUTPUT || true
|
||||||
echo "" >> $GITHUB_OUTPUT
|
echo "" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
echo "### Changed" >> $GITHUB_OUTPUT
|
echo "### Changed" >> $GITHUB_OUTPUT
|
||||||
git log --pretty=format:%s | grep -ivE '^(feat|fix|add|new)' | sed 's/^/- /' | sort -u >> $GITHUB_OUTPUT || true
|
git log --pretty=format:%s | grep -ivE '^(feat|fix|add|new)' | sed 's/^/- /' >> $GITHUB_OUTPUT || true
|
||||||
echo "EOF" >> $GITHUB_OUTPUT
|
echo "EOF" >> $GITHUB_OUTPUT
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
16
.github/workflows/github-release.yml
vendored
16
.github/workflows/github-release.yml
vendored
@ -76,14 +76,10 @@ jobs:
|
|||||||
- name: Generate Release Notes
|
- name: Generate Release Notes
|
||||||
id: release_notes
|
id: release_notes
|
||||||
run: |
|
run: |
|
||||||
# Fetch all tags first
|
|
||||||
git fetch --tags
|
|
||||||
|
|
||||||
# Get all tags sorted by version
|
# Get all tags sorted by version
|
||||||
TAGS=($(git tag -l 'v*' --sort=-v:refname))
|
TAGS=($(git tag -l 'v*' --sort=-v:refname))
|
||||||
CURRENT_TAG="${TAGS[0]}"
|
CURRENT_TAG="${TAGS[0]}"
|
||||||
|
|
||||||
# Get previous tag (second in list)
|
|
||||||
if [ ${#TAGS[@]} -gt 1 ]; then
|
if [ ${#TAGS[@]} -gt 1 ]; then
|
||||||
PREVIOUS_TAG="${TAGS[1]}"
|
PREVIOUS_TAG="${TAGS[1]}"
|
||||||
echo "CHANGES<<EOF" >> $GITHUB_OUTPUT
|
echo "CHANGES<<EOF" >> $GITHUB_OUTPUT
|
||||||
@ -92,15 +88,15 @@ jobs:
|
|||||||
|
|
||||||
# Get commits between previous and current tag
|
# Get commits between previous and current tag
|
||||||
echo "### Added" >> $GITHUB_OUTPUT
|
echo "### Added" >> $GITHUB_OUTPUT
|
||||||
git log ${PREVIOUS_TAG}..${CURRENT_TAG} --pretty=format:%s | grep -iE '^(feat|add|new)' | sed 's/^feat: /- /' | sort -u >> $GITHUB_OUTPUT || true
|
git log ${PREVIOUS_TAG}..${CURRENT_TAG} --pretty=format:%s | grep -iE '^(feat|add|new)' | sed 's/^feat: /- /' >> $GITHUB_OUTPUT || true
|
||||||
echo "" >> $GITHUB_OUTPUT
|
echo "" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
echo "### Fixed" >> $GITHUB_OUTPUT
|
echo "### Fixed" >> $GITHUB_OUTPUT
|
||||||
git log ${PREVIOUS_TAG}..${CURRENT_TAG} --pretty=format:%s | grep -iE '^fix' | sed 's/^fix: /- /' | sort -u >> $GITHUB_OUTPUT || true
|
git log ${PREVIOUS_TAG}..${CURRENT_TAG} --pretty=format:%s | grep -iE '^fix' | sed 's/^fix: /- /' >> $GITHUB_OUTPUT || true
|
||||||
echo "" >> $GITHUB_OUTPUT
|
echo "" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
echo "### Changed" >> $GITHUB_OUTPUT
|
echo "### Changed" >> $GITHUB_OUTPUT
|
||||||
git log ${PREVIOUS_TAG}..${CURRENT_TAG} --pretty=format:%s | grep -ivE '^(feat|fix|add|new)' | sed 's/^/- /' | sort -u >> $GITHUB_OUTPUT || true
|
git log ${PREVIOUS_TAG}..${CURRENT_TAG} --pretty=format:%s | grep -ivE '^(feat|fix|add|new)' | sed 's/^/- /' >> $GITHUB_OUTPUT || true
|
||||||
echo "EOF" >> $GITHUB_OUTPUT
|
echo "EOF" >> $GITHUB_OUTPUT
|
||||||
else
|
else
|
||||||
# First release or no previous tag
|
# First release or no previous tag
|
||||||
@ -110,15 +106,15 @@ jobs:
|
|||||||
# Add all commits for initial release
|
# Add all commits for initial release
|
||||||
echo "" >> $GITHUB_OUTPUT
|
echo "" >> $GITHUB_OUTPUT
|
||||||
echo "### Added" >> $GITHUB_OUTPUT
|
echo "### Added" >> $GITHUB_OUTPUT
|
||||||
git log --pretty=format:%s | grep -iE '^(feat|add|new)' | sed 's/^feat: /- /' | sort -u >> $GITHUB_OUTPUT || true
|
git log --pretty=format:%s | grep -iE '^(feat|add|new)' | sed 's/^feat: /- /' >> $GITHUB_OUTPUT || true
|
||||||
echo "" >> $GITHUB_OUTPUT
|
echo "" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
echo "### Fixed" >> $GITHUB_OUTPUT
|
echo "### Fixed" >> $GITHUB_OUTPUT
|
||||||
git log --pretty=format:%s | grep -iE '^fix' | sed 's/^fix: /- /' | sort -u >> $GITHUB_OUTPUT || true
|
git log --pretty=format:%s | grep -iE '^fix' | sed 's/^fix: /- /' >> $GITHUB_OUTPUT || true
|
||||||
echo "" >> $GITHUB_OUTPUT
|
echo "" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
echo "### Changed" >> $GITHUB_OUTPUT
|
echo "### Changed" >> $GITHUB_OUTPUT
|
||||||
git log --pretty=format:%s | grep -ivE '^(feat|fix|add|new)' | sed 's/^/- /' | sort -u >> $GITHUB_OUTPUT || true
|
git log --pretty=format:%s | grep -ivE '^(feat|fix|add|new)' | sed 's/^/- /' >> $GITHUB_OUTPUT || true
|
||||||
echo "EOF" >> $GITHUB_OUTPUT
|
echo "EOF" >> $GITHUB_OUTPUT
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user