File tree 1 file changed +17
-1
lines changed
1 file changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -38,11 +38,27 @@ jobs:
38
38
GPG_PRIVATE_KEY : ${{ secrets.GPG_PRIVATE_KEY }}
39
39
PASSPHRASE : ${{ secrets.PASSPHRASE }}
40
40
41
+ - name : Set GoReleaser args
42
+ run : |
43
+ if [[ "${{ github.ref }}" == refs/tags/v* ]]; then
44
+ RELEASE_NOTES_DIR=$(mktemp -d)
45
+ RELEASE_NOTES_FILE="$RELEASE_NOTES_DIR/release-notes.md"
46
+ git for-each-ref --format='%(body)' ${{ github.ref }} > "$RELEASE_NOTES_FILE"
47
+ echo "Release notes contents:"
48
+ cat "$RELEASE_NOTES_FILE"
49
+ GORELEASER_ARGS="--release-notes $RELEASE_NOTES_FILE"
50
+ echo "GORELEASER_ARGS=$GORELEASER_ARGS" >> $GITHUB_ENV
51
+ else
52
+ echo "Not a release tag, skipping release notes"
53
+ GORELEASER_ARGS="--snapshot"
54
+ echo "GORELEASER_ARGS=$GORELEASER_ARGS" >> $GITHUB_ENV
55
+ fi
56
+
41
57
- name : Run GoReleaser
42
58
uses : goreleaser/goreleaser-action@v6
43
59
with :
44
60
version : ~> v2
45
- args : release --clean ${{ !startsWith(github.ref, 'refs/tags/v') && '--snapshot' || '' }} --release-notes <(git for-each-ref --format='%(body)' ${{ github.ref }})
61
+ args : release --clean $GORELEASER_ARGS
46
62
env :
47
63
# use GITHUB_TOKEN that is already available in secrets.GITHUB_TOKEN
48
64
# https://docs.github.com/en/free-pro-team@latest/actions/reference/authentication-in-a-workflow#permissions-for-the-github_token
You can’t perform that action at this time.
0 commit comments