Skip to content

Commit f617110

Browse files
committed
fix: add create-discussion boolean input on release workflow
Signed-off-by: jmeridth <jmeridth@gmail.com>
1 parent ac9d639 commit f617110

2 files changed

Lines changed: 12 additions & 6 deletions

File tree

.github/workflows/release.yaml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,11 @@ on:
2121
required: false
2222
type: boolean
2323
default: false
24+
create-discussion:
25+
description: "Create discussion about release"
26+
required: false
27+
type: boolean
28+
default: false
2429
image-registry:
2530
description: "Container registry URL."
2631
required: false
@@ -287,7 +292,7 @@ jobs:
287292
288293
release_discussion:
289294
needs: create_release
290-
if: ${{ inputs.publish && needs.create_release.outputs.full-tag != '' }}
295+
if: ${{ inputs.create-discussion && inputs.publish && needs.create_release.outputs.full-tag != '' }}
291296
runs-on: ubuntu-latest
292297
permissions:
293298
contents: read # Required by harden-runner

docs/release.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ Consolidated release workflow that creates a draft release, optionally builds ar
99
permissions:
1010
contents: write
1111
pull-requests: read
12-
packages: write # only needed if building images
13-
id-token: write # only needed if creating attestations
14-
attestations: write # only needed if creating attestations
15-
discussions: write # only needed if creating discussions
12+
packages: write
13+
id-token: write
14+
attestations: write
15+
discussions: write
1616
with:
1717
# Publish the release after all jobs complete. When false, the release
1818
# remains a draft for manual review. Default is true.
@@ -42,6 +42,7 @@ Consolidated release workflow that creates a draft release, optionally builds ar
4242
# Attestation is only available for public repositories. Private repos
4343
# will see a warning and skip attestation automatically.
4444
create-attestation: true
45+
create-discussion: true
4546

4647
secrets:
4748
# The GitHub token to use (required)
@@ -81,7 +82,7 @@ The workflow runs up to six jobs:
8182
1. **create_release** - Always runs. Creates a draft release via release-drafter, then creates and pushes the full and major version git tags.
8283
2. **release_goreleaser** - Runs when `goreleaser-config-path` is set. Builds Go binaries, uploads artifacts to the draft release, and optionally creates attestations.
8384
3. **release_image** - Runs when `image-name` is set. Builds and pushes a multi-platform Docker image, and optionally creates attestations.
84-
4. **release_discussion** - Runs when both `discussion-category-id` and `discussion-repository-id` secrets are set. Creates a GitHub Discussions announcement.
85+
4. **release_discussion** - Runs when `create-discussion` is set. Both `discussion-category-id` and `discussion-repository-id` secrets are required if so. Creates a GitHub Discussions announcement.
8586
5. **publish_release** - Runs when `publish` is true and all preceding jobs succeed (or are skipped). Publishes the draft release.
8687

8788
## GoReleaser Configuration

0 commit comments

Comments
 (0)