Skip to content

A manual re-post of a release announcement works - #254

Merged
McCal-Codes merged 2 commits into
mainfrom
announce-manual-rerun
Oct 2, 2026
Merged

McCal-Codes merged 2 commits into
mainfrom
announce-manual-rerun

Conversation

@McCal-Codes

Copy link
Copy Markdown
Owner

What this changes

A manual re-run of the Announce workflow (Actions, Announce, Run workflow, with a tag) failed with "The event carries no release". The workflow wrote the release to event.json and set GITHUB_EVENT_PATH to it through GITHUB_ENV, but a step cannot change that variable: the runner keeps its own event file, which for a manual run has no release in it. An automatic run on a real publish was fine, because that event does carry the release.

  • The workflow's "Gather the release" step now writes release.json and sets RELEASE_FILE to it.
  • tools/announce-release.mjs reads RELEASE_FILE when it is set (the release itself), and falls back to GITHUB_EVENT_PATH (an event around it) as before.

I hit the same thing building the beta announcer for the private beta repository (McCal-Codes/folio-beta, .github/workflows/announce-beta.yml), where the first manual run said "Not a published release" and posted nothing, and fixed it there the same way.

How I checked it

  • node --test tools/announce-release.test.mjs: 16 pass (15 before and a new one that runs the script with RELEASE_FILE set and GITHUB_EVENT_PATH pointing at nothing).
  • Not run in GitHub yet. After the merge, Actions › Announce › Run workflow with a tag will prove it. That also needs the DISCORD_WEBHOOK_URLS secret, which is still unset on this repository (the only secret is FOLIO_SITE_TOKEN), so a real post is inert until it exists.

Cheap way out: revert; automatic runs behave as before either way.

  • No app change, so no CHANGELOG line (REL-7 skipped)

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 6b8581ee06

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

})

test('a manual re-post reads the release from RELEASE_FILE, which is the release itself and not an event around it', async () => {
const dir = mkdtempSync(join(tmpdir(), 'announce-'))

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Import the helpers used by the new test

Running node --test tools/announce-release.test.mjs now fails immediately with ReferenceError: mkdtempSync is not defined, so the new test never exercises RELEASE_FILE. The required mkdtempSync, writeFileSync, tmpdir, join, and spawn bindings are declared only inside the preceding test and are not visible here; import them at module scope or within this test.

Useful? React with 👍 / 👎.

@McCal-Codes
McCal-Codes merged commit bfb6e7f into main Oct 2, 2026
3 checks passed
@McCal-Codes
McCal-Codes deleted the announce-manual-rerun branch October 2, 2026 21:54
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.

1 participant