Restore the release actor lookup the failure notice references - #6632
Open
ynaamane wants to merge 1 commit into
Open
Restore the release actor lookup the failure notice references#6632ynaamane wants to merge 1 commit into
ynaamane wants to merge 1 commit into
Conversation
stacklok#4982 deleted the extract-release-actor job and the docs dispatch it fed, but left the Slack failure notice reading its output, so the notice silently falls back to github.actor (the release GitHub App, not a person) since the property is always undefined. Re-add the job, reading github.event.release.body through env: with no token and no checkout, avoiding the original's gh release view call that interpolated github.ref_name into run: (the injection shape already removed elsewhere in this file). Keep only the first Release-Triggered-By comment: a second one (for example folded in from a merged PR title by --generate-notes) would otherwise write a two-line value to GITHUB_OUTPUT, fail this job, and since it now sits in notify-release-failure's needs, fire a false alert on a release that actually succeeded. Log when no comment is found so a missing match is visible instead of silent. Signed-off-by: Naamane Yanis <naamaneyanis@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The release failure Slack notice reads
needs.extract-release-actor.outputs.triggered_by,but no job of that name exists in
releaser.ymlany more: #4982 removedextract-release-actortogether with the docs-website dispatch it fed, and left thepayload's reference behind. The expression is always undefined, so the notice falls
through to
github.actor, which onrelease: publishedis the release GitHub App ratherthan the person who started the release.
actionlintflags it:The producer side never went away:
create-release-tag.ymlstill reads theRelease-Triggered-Bytrailer from the release commit and writes<!-- Release-Triggered-By: X -->into the release notes "parsed by releaser.yml". Thisrestores the consumer.
extract-release-actorjob that readsgithub.event.release.bodythroughenv:and extracts the username from the HTML comment (same pattern as the job removedin Unify docs-website release pipeline: new assets + retire dispatch chain #4982).
permissions: {}, no token, no checkout, no${{ }}insiderun:.head -n 1):--generate-notescopies merged PR titles intothe body verbatim, so a second
Release-Triggered-Bycomment is reachable, and a two-linevalue would make the
GITHUB_OUTPUTwrite malformed and fail the job.notify-release-failure'sneeds:so the output is addressable again.When the comment is absent the output is empty, the step logs one line saying so, and the
payload's existing
|| github.actorfallback applies, as before.Fixes #6265
Type of change
Test plan
task test)task test-e2e)task lint-fix)The release workflow cannot run from a pull request, so the verification is static plus a
shell test of the extraction:
actionlint .github/workflows/releaser.yml: theextract-release-actorproperty erroris gone; the remaining output is byte-identical to
main(two pre-existing shellcheckinfos at lines 91 and 258, untouched here).
zizmor --persona regular .github/workflows/releaser.yml: same findings asmain, zeronew (the new job binds the release body through
env:and has no expression inrun:).run:body executed locally underbash -eagainst sample releasebodies: the comment present (yields the name), absent (empty value, the fallback log line,
exactly one
triggered_by=line written), an unrelated HTML comment first plus trailingwhitespace (yields the name), and the comment twice with different names on one line and
on two lines (yields exactly the first name and exactly one output line). Negative
control: without
head -n 1the two-comment bodies write two lines. Also checked underset -o pipefail: a no-match body exits 1 and a two-match body exits 141 fromheadclosing the pipe, which is why
|| truestays.needs:entry brings the actionlint error back; removing the job whilekeeping the
needs:entry produces the unknown-job error. Both restored.Does this introduce a user-facing change?
No.