Skip to content

Conversation

@BYK
Copy link
Member

@BYK BYK commented Jan 15, 2026

Summary

Adds a comment: true|false input to the changelog-preview workflow to reduce notification noise. When set to false, the workflow creates a commit status instead of posting PR comments.

Changes

  • New Input: comment (boolean, defaults to true for backward compatibility)
  • Status Check Mode (comment: false):
    • Creates a commit status named "Changelog Preview / Semver Impact"
    • Shows semver impact clearly (e.g., "Minor", "Major", "Patch")
    • Status appears independently in PR checks (not grouped with other workflows)
    • Links to GitHub Actions job summary with full changelog preview
    • Reduces notification noise significantly
  • Comment Mode (comment: true, default):
    • Preserves existing PR comment behavior
    • Maintains backward compatibility
  • Dogfooding: Craft's own PRs automatically use status check mode

Implementation Details

Uses the Commit Status API rather than Check Runs API because:

  • Works reliably with GITHUB_TOKEN (no GitHub App required)
  • Appears as independent status (no grouping under other workflows)
  • Simpler implementation
  • Status description limited to plain text (no emoji support)

The full changelog is always available in the GitHub Actions job summary (accessible via the status link).

Documentation

Updated docs/src/content/docs/github-actions.md with:

  • New comment input documentation
  • "Output Modes" section explaining both modes with pros/cons
  • Examples for both comment and status check modes
  • Updated permissions requirements (statuses: write for status check mode)

Example

This PR demonstrates status check mode. Look for:

Changelog Preview / Semver Impact — Minor

in the checks section below.

Add a `comment` input to the changelog-preview workflow that allows
users to choose between posting PR comments (default) or creating check
runs with job summaries.

When `comment: false`:
- Creates a neutral check run named "Changelog" with the semver impact
- Includes full changelog preview in the check run summary
- Writes to GitHub Actions job summary for easy access
- Reduces notification noise compared to PR comments

When `comment: true` (default):
- Preserves existing behavior of posting/updating PR comments
- Maintains backward compatibility for all existing users

For Craft's own repository, the workflow automatically uses check run
mode when triggered via pull_request events (dogfooding).

Documentation updated to explain both modes with examples, pros/cons,
and required permissions for each mode.
@github-actions
Copy link
Contributor

github-actions bot commented Jan 15, 2026

PR Preview Action v1.8.0
Preview removed because the pull request was closed.
2026-01-15 20:30 UTC

- Add 'Semver impact: ' prefix to check run title for clarity
- Remove unnecessary footer link from job summary
- Use jq to safely construct JSON payload
- Add details_url to link to Actions run
- Include full changelog in output.summary
- Add explicit API version header
Remove duplicate 'Semver Impact' header - it's already in the title
Remove extra explanatory text to clean up the display
The Check Runs API was causing grouping issues in the GitHub UI where
the 'Changelog' check was being grouped under other workflows like
'CodeQL'. The Commit Status API provides a cleaner solution:

- Status appears independently in the checks list (not grouped)
- Simpler API with fewer parameters
- Works reliably with GITHUB_TOKEN
- Still shows semver impact prominently

Changes:
- Replace check runs creation with commit status creation
- Update permissions from checks:write to statuses:write
- Update all documentation references
- Simplify implementation (no need for complex JSON with jq)
- Full changelog still available in Actions job summary
Commit Status API doesn't support 4-byte Unicode (emojis).
Keep emojis in BUMP_BADGE for display, but use plain text
for the status description field.
- Change context from 'Changelog' to 'Changelog Preview / Semver Impact'
- Simplify description to just the bump type (e.g., 'Minor')
- Remove 'Semver impact:' prefix since it's now in the context name

Result: Status shows as 'Changelog Preview / Semver Impact — Minor'
Comment on lines +164 to +172
BUMP_EMOJI="🔴"
;;
minor)
BUMP_SHORT="Minor"
BUMP_EMOJI="🟡"
;;
patch)
BUMP_SHORT="Patch"
BUMP_EMOJI="🟢"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that color codes are WORLDWIDE known to signal:
green: go ahead, yellow: warning, and red: don't.

what about using arbitrary colors instead ☮️

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That was kind of the intention though?

Patch -> Always safe
Minor -> Might be safe
Major -> Danger, be careful!

@BYK BYK marked this pull request as ready for review January 15, 2026 20:29
@BYK BYK merged commit 982ed0f into master Jan 15, 2026
17 of 18 checks passed
@BYK BYK deleted the opencode/happy-circuit branch January 15, 2026 20:29
supervacuus added a commit to getsentry/sentry-java that referenced this pull request Jan 22, 2026
Which aligns with the permission requirements here: getsentry/craft#722
supervacuus added a commit to getsentry/sentry-java that referenced this pull request Jan 22, 2026
* chore(ci): write permission for statuses in changelog preview

Which aligns with the permission requirements here: getsentry/craft#722

* Update CHANGELOG
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants