Skip to content

Strip JS comment steps from submit/apply; add github-decision + artifact upload - #324

Open
Mpdreamz wants to merge 1 commit into
mainfrom
feature/changelog-pr-comment-part3
Open

Strip JS comment steps from submit/apply; add github-decision + artifact upload#324
Mpdreamz wants to merge 1 commit into
mainfrom
feature/changelog-pr-comment-part3

Conversation

@Mpdreamz

@Mpdreamz Mpdreamz commented Sep 1, 2026

Copy link
Copy Markdown
Member

The three actions/github-script comment steps and their four JS scripts are removed from changelog/submit/apply. Commenting now happens in the downstream release-notes-comments workflow (added in #323). A new shell step records the commit outcome into the metadata and uploads it as changelog-decision so the comment workflow picks it up.

Affects: Release notes, Automation

Why

Commenting from inside submit/apply required pull-requests: write on the commit job. The JS scripts (post-success-comment.js, post-comment-only.js, post-failure-comment.js) were the only things in the repo that posted PR comments. Moving them to a dedicated workflow_run job with its own token gives the commit job a narrower permission set and lets any future consumer opt into comments by copying one file instead of modifying the submit workflow. The three steps also lacked continue-on-error: true, so a transient 403 from the GitHub API could fail a run that otherwise committed the entry successfully.

What

JS scripts removed

All four scripts in changelog/submit/apply/scripts/ (comment-helper.js, post-success-comment.js, post-comment-only.js, post-failure-comment.js) are deleted. The config input — used only by post-failure-comment.js — is also removed from the composite.

Record decision and stage comment artifact step

After the commit step, a single shell step runs if: always() with continue-on-error: true. It copies the staging metadata and generated YAML into .artifacts/changelog-decision/, calls changelog github-decision --commit-outcome <committed|failed|none> to stamp the outcome, and sets --committed-file when the commit succeeded. The directory layout matches what changelog github-comment expects.

Upload decision artifact step

Uploads .artifacts/changelog-decision as changelog-decision with if: always() and continue-on-error: true, if-no-files-found: ignore. The downstream release-notes-comments workflow (PR #323) picks this up with pull-requests: write and posts or updates the sticky comment.

Verify

Open a PR in a repo that has release-notes-comments.yml wired up. The Changelog submit workflow should complete without posting a comment itself. A few seconds later the Changelog PR comments workflow should run and post (or update) the sticky ### 📋 Changelog comment.

Stack: 3 of 4, on top of #323. PR 4 drops should-comment-success / should-comment-failure from docs-builder once this PR is merged and no code reads those outputs.

Risk: elastic/cloud currently reads should-comment-success and should-comment-failure from submit/apply/evaluate-artifact. Those outputs are on ChangelogArtifactEvaluationService, not apply. They are dropped in the coordinated docs-builder PR 4 — this PR does not touch them.

Out of scope: changelog/submit/evaluate is untouched. changelog-submit.yml is untouched. elastic/cloud's consumer workflow must have release-notes-comments.yml in place on its default branch before this PR is merged.

…act upload

The three actions/github-script comment steps (post-success-comment,
post-comment-only, post-failure-comment) and their four JS scripts are
removed. In their place, a single shell step copies the staging metadata
and YAML into .artifacts/changelog-decision/, calls
changelog github-decision to stamp CommitOutcome, then uploads the
changelog-decision artifact with if: always() and continue-on-error: true.

The downstream release-notes-comments workflow (added in #323) picks up
this artifact and posts the sticky comment with pull-requests: write,
keeping comment responsibility out of the commit job.

The config input is removed from the action; it was only used in the now-
deleted post-failure-comment step.

Co-Authored-By: Claude <noreply@anthropic.com>
@Mpdreamz
Mpdreamz requested a review from a team as a code owner September 1, 2026 15:53
@Mpdreamz Mpdreamz added the enhancement New feature or request label Sep 1, 2026
@Mpdreamz
Mpdreamz requested a review from theletterf September 1, 2026 15:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant