fix: resolve semantic-release CHANGELOG.md not updating properly
Agent-Logs-Url: https://github.com/christianlouis/InboxConverge/sessions/36c964fc-1fc5-4b0a-b223-43a033f7b26b Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
This commit is contained in:
@@ -56,13 +56,12 @@ jobs:
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
run: |
|
||||
if git diff --name-only HEAD~1 2>/dev/null | grep -q CHANGELOG.md; then
|
||||
echo "CHANGELOG.md was already updated by semantic-release version"
|
||||
# Detect whether `semantic-release version` just created a version commit.
|
||||
# PSR's version commits have a bare version number as the subject (e.g. "0.2.2").
|
||||
# If the latest commit matches that pattern the changelog was already updated.
|
||||
LAST_COMMIT_MSG=$(git log -1 --format="%s")
|
||||
if echo "$LAST_COMMIT_MSG" | grep -qP "^\d+\.\d+\.\d+$"; then
|
||||
echo "semantic-release created version commit '$LAST_COMMIT_MSG' - CHANGELOG.md already updated"
|
||||
else
|
||||
semantic-release changelog
|
||||
if ! git diff --quiet CHANGELOG.md; then
|
||||
git add CHANGELOG.md
|
||||
git commit -m "docs(changelog): update changelog [skip ci]"
|
||||
git push
|
||||
fi
|
||||
echo "No new version was released; CHANGELOG.md unchanged"
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user