From d710f2366d0d5924034d29d87520168fc1069e19 Mon Sep 17 00:00:00 2001 From: "P." Date: Wed, 18 Nov 2026 10:02:27 -0600 Subject: [PATCH] ci(publish): announce a published testing release to subscribers After the Grype gate that already guards the promote, send a release-published repository_dispatch with the version and tag to the repositories that follow releases. The repositories and the GitHub App that signs the token come from secrets in the testing environment; the job is a no-op until they are set. Co-authored-by: Claude Opus 5.5 --- .github/workflows/publish-testing.yml | 54 +++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) diff --git a/.github/workflows/publish-testing.yml b/.github/workflows/publish-testing.yml index 38093a5..074c698 100644 --- a/.github/workflows/publish-testing.yml +++ b/.github/workflows/publish-testing.yml @@ -47,6 +47,10 @@ name: Publish testing images + promote # in the customers account via OIDC; the image-updater Lambda there rolls every # tier=testing service (new image + fresh extras together). The full-stack image # is not part of the managed fleet, so it has no SSM tier. +# +# Notify subscribers: after the same scan gate, announces the published release to +# the repositories that follow it. Skipped until the `testing` environment has the +# RELEASE_NOTIFY_* secrets. on: push: @@ -335,6 +339,56 @@ jobs: --region "$AWS_REGION" echo "promoted $SSM_PARAM = ${VERSION}-php85" >> "$GITHUB_STEP_SUMMARY" + notify-subscribers: + name: Notify subscribers — release published + needs: [resolve, scan-minimal] + # NOTE: same gate as promote: never for a dry run, never past a failed scan. + if: ${{ needs.resolve.outputs.dry_run != 'true' }} + environment: testing + runs-on: ubuntu-latest + timeout-minutes: 5 + permissions: {} + steps: + - name: Check notifications are configured + id: wired + env: + CLIENT_ID: ${{ secrets.RELEASE_NOTIFY_CLIENT_ID }} + run: | + if [ -n "$CLIENT_ID" ]; then + echo "wired=true" >> "$GITHUB_OUTPUT" + else + echo "::notice::RELEASE_NOTIFY_CLIENT_ID is not set; no one is notified" + echo "wired=false" >> "$GITHUB_OUTPUT" + fi + + - name: Mint a token for the subscribers + if: steps.wired.outputs.wired == 'true' + id: token + uses: actions/create-github-app-token@64ab729a6294000f5aa4a4bc0b73d1f32bc45510 # v3.3.0 + with: + client-id: ${{ secrets.RELEASE_NOTIFY_CLIENT_ID }} + private-key: ${{ secrets.RELEASE_NOTIFY_PRIVATE_KEY }} + owner: ${{ github.repository_owner }} + repositories: ${{ secrets.RELEASE_NOTIFY_REPOSITORIES }} + permission-contents: write + + - name: Send release-published + if: steps.wired.outputs.wired == 'true' + env: + GH_TOKEN: ${{ steps.token.outputs.token }} + OWNER: ${{ github.repository_owner }} + REPOSITORIES: ${{ secrets.RELEASE_NOTIFY_REPOSITORIES }} + VERSION: ${{ needs.resolve.outputs.version }} + run: | + set -euo pipefail + for repo in ${REPOSITORIES//,/ }; do + gh api "repos/${OWNER}/${repo}/dispatches" \ + -f event_type=release-published \ + -f "client_payload[version]=${VERSION}" \ + -f "client_payload[tag]=${VERSION}-php85" >/dev/null + done + echo "announced ${VERSION}-php85" >> "$GITHUB_STEP_SUMMARY" + # The full-stack image is built here for the same build-once reason as the # minimal one: GA promotes this digest rather than rebuilding from the prod # bundle. It is amd64-only, matching what the release build published before.