From 89cf1cc4b1bf0b2f88d788e6ff915fcaa9ff7633 Mon Sep 17 00:00:00 2001 From: Jose Tomas Robles Hahn Date: Mon, 14 Sep 2026 11:08:11 -0300 Subject: [PATCH 1/2] fix: Write the job summary of a release task from a single step - GitHub renders the summary of each step as a Markdown document of its own and joins them with a blank line, so the reviewers, written by a later step than the rest, ended up as a list of their own rather than as the last item of the one above them. - The summary is therefore written last, by a step that does nothing else, out of the outputs of the steps that produced the values. The step that requests the reviews now records the users in outputs instead of writing them to the summary itself. - The step runs unless the run was cancelled, rather than only on success, so that a failure after the pull request was opened still leaves its URL in the summary. Co-Authored-By: Claude Opus 5 --- .../task-release-and-deploy-to-prod.yaml | 69 +++++++++++-------- .../workflows/task-release-and-publish.yaml | 46 ++++++++----- 2 files changed, 71 insertions(+), 44 deletions(-) diff --git a/.github/workflows/task-release-and-deploy-to-prod.yaml b/.github/workflows/task-release-and-deploy-to-prod.yaml index 835fa7e..c6eb479 100644 --- a/.github/workflows/task-release-and-deploy-to-prod.yaml +++ b/.github/workflows/task-release-and-deploy-to-prod.yaml @@ -99,15 +99,6 @@ jobs: else echo 'There is nothing to release. The remaining steps will be skipped.' echo 'has_changes=false' >> "$GITHUB_OUTPUT" - - { - echo '# Release and Deploy to Production' - echo - echo 'Nothing to release.' - echo - echo "- **From:** \`$RELEASE_VCS_REF\`" - echo "- **Into:** \`$PRODUCTION_VCS_REF\`" - } >> "$GITHUB_STEP_SUMMARY" fi - name: Prepare Release @@ -158,19 +149,8 @@ jobs: )" echo "url=${github_pull_request_url:?}" >> "$GITHUB_OUTPUT" - - { - echo '# Release and Deploy to Production' - echo - echo "$github_pull_request_url" - echo - echo "- **Changes:** $CHANGE_COUNT" - echo "- **From:** \`$RELEASE_VCS_REF\`" - echo "- **Into:** \`$PRODUCTION_VCS_REF\`" - } >> "$GITHUB_STEP_SUMMARY" env: GH_TOKEN: ${{ github.token }} - CHANGE_COUNT: ${{ steps.check_changes.outputs.change_count }} RELEASE_ASSIGNEE: ${{ github.actor }} CHANGELOG_FILE_PATH: ${{ steps.generate_changelog.outputs.changelog_file_path }} GITHUB_PULL_REQUEST_LABELS: ${{ inputs.github_pull_request_labels }} @@ -208,6 +188,7 @@ jobs: POST_DEPLOYMENT_CHECKLIST_ITEMS: ${{ inputs.post_deployment_checklist_items }} - name: Request Reviews from Change Authors + id: request_reviews if: >- ${{ steps.check_changes.outputs.has_changes == 'true' && inputs.request_reviews_from_change_authors }} @@ -253,16 +234,50 @@ jobs: done { - if [ "${#requested_reviewers[@]}" -gt 0 ]; then - echo "- **Reviewers:** ${requested_reviewers[*]}" + echo "requested_reviewers=${requested_reviewers[*]}" + echo "rejected_reviewers=${rejected_reviewers[*]}" + } >> "$GITHUB_OUTPUT" + env: + GH_TOKEN: ${{ github.token }} + GITHUB_PULL_REQUEST_URL: ${{ steps.create_github_pull_request.outputs.url }} + + # No other step may write to $GITHUB_STEP_SUMMARY: GitHub renders each step's summary as a + # Markdown document of its own and joins them with a blank line, which splits the list below. + - name: Write Job Summary + if: ${{ !cancelled() && steps.check_changes.outcome == 'success' }} + run: | + { + echo '# Release and Deploy to Production' + echo + + if [ "$HAS_CHANGES" != 'true' ]; then + echo 'Nothing to release.' + echo + echo "- **From:** \`$RELEASE_VCS_REF\`" + echo "- **Into:** \`$PRODUCTION_VCS_REF\`" else - echo '- **Reviewers:** nobody' - fi + if [ -n "$GITHUB_PULL_REQUEST_URL" ]; then + echo "$GITHUB_PULL_REQUEST_URL" + echo + fi + + echo "- **Changes:** $CHANGE_COUNT" + echo "- **From:** \`$RELEASE_VCS_REF\`" + echo "- **Into:** \`$PRODUCTION_VCS_REF\`" + + if [ "$REQUEST_REVIEWS_FROM_CHANGE_AUTHORS" = 'true' ]; then + echo "- **Reviewers:** ${REQUESTED_REVIEWERS:-nobody}" + fi - if [ "${#rejected_reviewers[@]}" -gt 0 ]; then - echo "- **Reviewers GitHub rejected:** ${rejected_reviewers[*]}" + if [ -n "$REJECTED_REVIEWERS" ]; then + echo "- **Reviewers GitHub rejected:** $REJECTED_REVIEWERS" + fi fi } >> "$GITHUB_STEP_SUMMARY" env: - GH_TOKEN: ${{ github.token }} + HAS_CHANGES: ${{ steps.check_changes.outputs.has_changes }} + CHANGE_COUNT: ${{ steps.check_changes.outputs.change_count }} GITHUB_PULL_REQUEST_URL: ${{ steps.create_github_pull_request.outputs.url }} + REQUEST_REVIEWS_FROM_CHANGE_AUTHORS: ${{ inputs.request_reviews_from_change_authors }} + REQUESTED_REVIEWERS: ${{ steps.request_reviews.outputs.requested_reviewers }} + REJECTED_REVIEWERS: ${{ steps.request_reviews.outputs.rejected_reviewers }} diff --git a/.github/workflows/task-release-and-publish.yaml b/.github/workflows/task-release-and-publish.yaml index d000a8b..6b62735 100644 --- a/.github/workflows/task-release-and-publish.yaml +++ b/.github/workflows/task-release-and-publish.yaml @@ -100,21 +100,12 @@ jobs: )" echo "url=${github_pull_request_url:?}" >> "$GITHUB_OUTPUT" - - { - echo '# Release and Publish' - echo - echo "$github_pull_request_url" - echo - echo "- **From:** \`$CREATE_RELEASE_VCS_REF\`" - echo "- **Into:** \`$RELEASE_VCS_REF\`" - echo "- **Release:** $PREPARE_RELEASE_GITHUB_PULL_REQUEST_HTML_URL" - } >> "$GITHUB_STEP_SUMMARY" env: GH_TOKEN: ${{ github.token }} GITHUB_PULL_REQUEST_LABELS: ${{ inputs.github_pull_request_labels }} - name: Request Reviews from Change Authors + id: request_reviews if: ${{ inputs.request_reviews_from_change_authors }} run: | github_pull_request_number="$( @@ -158,16 +149,37 @@ jobs: done { - if [ "${#requested_reviewers[@]}" -gt 0 ]; then - echo "- **Reviewers:** ${requested_reviewers[*]}" - else - echo '- **Reviewers:** nobody' + echo "requested_reviewers=${requested_reviewers[*]}" + echo "rejected_reviewers=${rejected_reviewers[*]}" + } >> "$GITHUB_OUTPUT" + env: + GH_TOKEN: ${{ github.token }} + GITHUB_PULL_REQUEST_URL: ${{ steps.create_github_pull_request.outputs.url }} + + # No other step may write to $GITHUB_STEP_SUMMARY: GitHub renders each step's summary as a + # Markdown document of its own and joins them with a blank line, which splits the list below. + - name: Write Job Summary + if: ${{ !cancelled() && steps.create_github_pull_request.outcome == 'success' }} + run: | + { + echo '# Release and Publish' + echo + echo "$GITHUB_PULL_REQUEST_URL" + echo + echo "- **From:** \`$CREATE_RELEASE_VCS_REF\`" + echo "- **Into:** \`$RELEASE_VCS_REF\`" + echo "- **Release:** $PREPARE_RELEASE_GITHUB_PULL_REQUEST_HTML_URL" + + if [ "$REQUEST_REVIEWS_FROM_CHANGE_AUTHORS" = 'true' ]; then + echo "- **Reviewers:** ${REQUESTED_REVIEWERS:-nobody}" fi - if [ "${#rejected_reviewers[@]}" -gt 0 ]; then - echo "- **Reviewers GitHub rejected:** ${rejected_reviewers[*]}" + if [ -n "$REJECTED_REVIEWERS" ]; then + echo "- **Reviewers GitHub rejected:** $REJECTED_REVIEWERS" fi } >> "$GITHUB_STEP_SUMMARY" env: - GH_TOKEN: ${{ github.token }} GITHUB_PULL_REQUEST_URL: ${{ steps.create_github_pull_request.outputs.url }} + REQUEST_REVIEWS_FROM_CHANGE_AUTHORS: ${{ inputs.request_reviews_from_change_authors }} + REQUESTED_REVIEWERS: ${{ steps.request_reviews.outputs.requested_reviewers }} + REJECTED_REVIEWERS: ${{ steps.request_reviews.outputs.rejected_reviewers }} From e4651a040ea90a25e31186e702a2dbd231e2cda2 Mon Sep 17 00:00:00 2001 From: Jose Tomas Robles Hahn Date: Mon, 14 Sep 2026 11:12:08 -0300 Subject: [PATCH 2/2] fix: Keep the release checklist comment free of hard wrapping - GitHub renders every newline of a comment as a line break, so a hard-wrapped checklist item reaches the pull request broken across lines. The items this workflow contributes were already joined by a line continuation, but nothing said so to the callers that supply their own, and theirs arrive wrapped. The description of both inputs now states it. - The continuation of the common pre-deployment item was aligned under the text it continues, and that alignment survived the join as a run of seven spaces in the comment body. It now continues without indentation, as the tip above it already does. Co-Authored-By: Claude Opus 5 --- .github/workflows/task-release-and-deploy-to-prod.yaml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/task-release-and-deploy-to-prod.yaml b/.github/workflows/task-release-and-deploy-to-prod.yaml index c6eb479..ce49d82 100644 --- a/.github/workflows/task-release-and-deploy-to-prod.yaml +++ b/.github/workflows/task-release-and-deploy-to-prod.yaml @@ -39,13 +39,15 @@ on: required: false description: >- Repository-specific items of the pre-deployment checklist, in Markdown. They are added - after the items that are common to every repository. + after the items that are common to every repository. An item must not be hard-wrapped, + because GitHub renders every newline of a comment as a line break. post_deployment_checklist_items: type: string required: false description: >- Repository-specific items of the post-deployment checklist, in Markdown. They are added - before the items that are common to every repository. + before the items that are common to every repository. An item must not be hard-wrapped, + because GitHub renders every newline of a comment as a line break. permissions: {} @@ -172,7 +174,7 @@ jobs: ## Pre-Deployment Checklist - [ ] Are there any **errors** 🚨 affecting the **staging** deployment environment \ - that would break the **production** environment 🔥? + that would break the **production** environment 🔥? ${PRE_DEPLOYMENT_CHECKLIST_ITEMS} ## Post-Deployment Checklist