From 5267837b465bebc6a28e1cbe7370acd3ff977102 Mon Sep 17 00:00:00 2001 From: Nicolas DUBIEN Date: Thu, 9 Jul 2026 00:36:16 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=91=B7=20Announce=20on=20Bluesky=20when?= =?UTF-8?q?=20drafting=20the=20release=20(#7127)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Description > AI-agent disclosure: this PR was authored by an automated agent (Claude Code) and has not been line-by-line reviewed by a human before submission. Releases of fast-check and its sibling packages will now actually be announced on Bluesky: the "Announce Release on Bluesky" workflow added in #6959 has never fired once. The announcement now goes out when the maintainer dispatches the Create Release workflow, right after the draft release is created and the tag pushed, and the wording is adjusted to match that timing β€” `πŸš€ New release on its way: fast-check v4.9.0`, followed by a link to the release notes. The linked release page goes live a few minutes later, once the publish pipeline flips the draft to published. Dry runs of Create Release skip the post. Why it never fired: the workflow listened to `release: published`, but releases are flipped from draft to published by `softprops/action-gh-release` inside the publish jobs using the default `GITHUB_TOKEN`, and GitHub suppresses events created with that token from triggering other workflows. Its `discussion_url != ''` guard was dead too, since #6975 dropped discussion creation on releases. Design: `announce-release-bluesky.yml` becomes a reusable `workflow_call` taking the release tag, invoked from a new `announce-release` job in `create-release.yml` β€” which now re-exports the tag computed by its changelog-extract step as a job output. Alternatives considered and rejected: publishing releases with a PAT so `release: published` fires (a new long-lived secret to manage), or wiring the announcement into the seven publish jobs of `build-status.yml` (couples the social post to the publish pipeline). Anchoring on the human-dispatched Create Release needs no new secret and leaves `build-status.yml` untouched. The Bluesky secrets are declared and passed explicitly to the called workflow rather than via `secrets: inherit`, so only the three `BLUESKY_*` secrets are in its reach. Impact level: patch, CI-only β€” no published package changes, hence no changeset. The PR stays focused on a single concern: making the Bluesky announcement flow fire. No automated tests were added: the change is workflow glue around the existing, already smoke-tested `post-bluesky.mjs`; YAML validity and the tagβ†’URL/label mapping (including slashed tags like `packaged/v0.7.1`) were verified locally. ## Checklist β€” _Don't delete this checklist and make sure you do the following before opening the PR_ - [ ] I have a full understanding of every line in this PR β€” whether the code was hand-written, AI-generated, copied from external sources or produced by any other tool - [ ] I flagged the impact of my change (minor / patch / major) either by running `pnpm run bump` or by following the instructions from the changeset bot - [ ] I kept this PR focused on a single concern and did not bundle unrelated changes - [ ] I followed the [gitmoji](https://gitmoji.dev/) specification for the name of the PR, including the package scope (e.g. `πŸ›(vitest) Something...`) when the change targets a package other than `fast-check` - [ ] I added relevant tests and they would have failed without my PR (when applicable) --------- Co-authored-by: Claude --- .../workflows/announce-release-bluesky.yml | 20 ++++++++++++++----- .github/workflows/create-release.yml | 13 ++++++++++++ .github/workflows/scripts/post-bluesky.mjs | 2 +- 3 files changed, 29 insertions(+), 6 deletions(-) diff --git a/.github/workflows/announce-release-bluesky.yml b/.github/workflows/announce-release-bluesky.yml index 59ac4d54..31fb4bb9 100644 --- a/.github/workflows/announce-release-bluesky.yml +++ b/.github/workflows/announce-release-bluesky.yml @@ -1,8 +1,19 @@ name: Announce Release on Bluesky on: - release: - types: [published] + workflow_call: + inputs: + tag: + description: 'Tag of the release to announce' + required: true + type: string + secrets: + BLUESKY_URL: + required: true + BLUESKY_IDENTIFIER: + required: true + BLUESKY_APP_PASSWORD: + required: true permissions: contents: read @@ -10,7 +21,6 @@ permissions: jobs: announce: name: 'Post release announcement on Bluesky' - if: github.event.release.discussion_url != '' runs-on: ubuntu-latest steps: - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 @@ -30,6 +40,6 @@ jobs: BLUESKY_URL: ${{ secrets.BLUESKY_URL }} BLUESKY_IDENTIFIER: ${{ secrets.BLUESKY_IDENTIFIER }} BLUESKY_APP_PASSWORD: ${{ secrets.BLUESKY_APP_PASSWORD }} - RELEASE_TAG: ${{ github.event.release.tag_name }} - RELEASE_URL: ${{ github.event.release.html_url }} + RELEASE_TAG: ${{ inputs.tag }} + RELEASE_URL: https://github.com/${{ github.repository }}/releases/tag/${{ inputs.tag }} run: node .github/workflows/scripts/post-bluesky.mjs diff --git a/.github/workflows/create-release.yml b/.github/workflows/create-release.yml index 796319cc..616b6d21 100644 --- a/.github/workflows/create-release.yml +++ b/.github/workflows/create-release.yml @@ -30,6 +30,8 @@ jobs: runs-on: ubuntu-latest permissions: contents: write + outputs: + tag: ${{ steps.changelog.outputs.tag }} steps: - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 with: @@ -67,3 +69,14 @@ jobs: git push origin "refs/tags/$TAG" env: TAG: ${{ steps.changelog.outputs.tag }} + announce-release: + name: 'Announce release' + needs: create-release + if: ${{ github.event.inputs.dry_run != 'true' }} + uses: ./.github/workflows/announce-release-bluesky.yml + with: + tag: ${{ needs.create-release.outputs.tag }} + secrets: + BLUESKY_URL: ${{ secrets.BLUESKY_URL }} + BLUESKY_IDENTIFIER: ${{ secrets.BLUESKY_IDENTIFIER }} + BLUESKY_APP_PASSWORD: ${{ secrets.BLUESKY_APP_PASSWORD }} diff --git a/.github/workflows/scripts/post-bluesky.mjs b/.github/workflows/scripts/post-bluesky.mjs index 146d6c3d..91b90689 100644 --- a/.github/workflows/scripts/post-bluesky.mjs +++ b/.github/workflows/scripts/post-bluesky.mjs @@ -11,7 +11,7 @@ const session = new CredentialSession(new URL(url)); await session.login({ identifier, password }); const agent = new Agent(session); -const text = `πŸš€ New release: ${formatReleaseLabel(releaseTag)}\n\nSneak peek at the release notes: ${releaseUrl}`; +const text = `πŸš€ New release on its way: ${formatReleaseLabel(releaseTag)}\n\nRelease notes will land shortly at: ${releaseUrl}`; const richText = new RichText({ text }); await richText.detectFacets(agent); -- 2.51.2