Skip to content

Commit 950ddd5

Browse files
Only cut releases if we've seen material changes (#1891)
This adjusts the weekly release process to only cut a release if something material has changed. This is to avoid version bloat on CI-only changes or README touchups.
1 parent 1e6fa1f commit 950ddd5

File tree

1 file changed

+26
-2
lines changed

1 file changed

+26
-2
lines changed

.github/workflows/release.yaml

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,32 @@ jobs:
3232
git fetch --tags
3333
TAG=$(git tag --points-at HEAD)
3434
if [ -z "$TAG" ]; then
35-
echo "No tag points at HEAD, so we need a new tag and then a new release."
36-
echo "need_release=yes" >> $GITHUB_OUTPUT
35+
echo "No tag points at HEAD, checking if changes warrant a release."
36+
37+
# Get the last release tag
38+
LAST_TAG=$(git describe --tags --abbrev=0 2>/dev/null || echo "")
39+
40+
if [ -n "$LAST_TAG" ]; then
41+
echo "Last release tag: $LAST_TAG"
42+
43+
# Get all changed files since last tag
44+
CHANGED_FILES=$(git diff --name-only "$LAST_TAG"..HEAD)
45+
46+
# Only release if changes include .go files, go.mod, go.sum, or LICENSE
47+
RELEASE_WORTHY_CHANGES=$(echo "$CHANGED_FILES" | grep -E '(\.go$|^go\.mod$|^go\.sum$|^LICENSE$)' || true)
48+
49+
if [ -z "$RELEASE_WORTHY_CHANGES" ]; then
50+
echo "No Go source files, go.mod, go.sum, or LICENSE changed since last release. Skipping release."
51+
echo "need_release=no" >> $GITHUB_OUTPUT
52+
else
53+
echo "Found release-worthy changes since last release:"
54+
echo "$RELEASE_WORTHY_CHANGES"
55+
echo "need_release=yes" >> $GITHUB_OUTPUT
56+
fi
57+
else
58+
echo "No previous tags found. Creating first release."
59+
echo "need_release=yes" >> $GITHUB_OUTPUT
60+
fi
3761
else
3862
RELEASE=$(gh release view "$TAG" --json tagName --jq '.tagName' || echo "none")
3963
if [ "$RELEASE" == "$TAG" ]; then

0 commit comments

Comments
 (0)