-
-
Notifications
You must be signed in to change notification settings - Fork 18
feat(github): Add comment option to changelog-preview workflow #722
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
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.
|
- 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'
| BUMP_EMOJI="🔴" | ||
| ;; | ||
| minor) | ||
| BUMP_SHORT="Minor" | ||
| BUMP_EMOJI="🟡" | ||
| ;; | ||
| patch) | ||
| BUMP_SHORT="Patch" | ||
| BUMP_EMOJI="🟢" |
There was a problem hiding this comment.
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 ☮️
There was a problem hiding this comment.
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!
Which aligns with the permission requirements here: getsentry/craft#722
* chore(ci): write permission for statuses in changelog preview Which aligns with the permission requirements here: getsentry/craft#722 * Update CHANGELOG
Summary
Adds a
comment: true|falseinput to the changelog-preview workflow to reduce notification noise. When set tofalse, the workflow creates a commit status instead of posting PR comments.Changes
comment(boolean, defaults totruefor backward compatibility)comment: false):comment: true, default):Implementation Details
Uses the Commit Status API rather than Check Runs API because:
GITHUB_TOKEN(no GitHub App required)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.mdwith:commentinput documentationstatuses: writefor status check mode)Example
This PR demonstrates status check mode. Look for:
in the checks section below.