@@ -709,8 +709,19 @@ jobs:
709709 " 2>/dev/null || true)
710710 echo "dirs=$DIRS" >> "$GITHUB_OUTPUT"
711711
712+ # Load the reporter from the same trusted revision as this workflow,
713+ # before either session can edit files in the PR checkout.
714+ - name : Prepare session reporter
715+ id : session_reporter
716+ env :
717+ WORKFLOW_SHA : ${{ github.workflow_sha }}
718+ run : |
719+ REPORTER=$(mktemp "$RUNNER_TEMP/release-session-report.XXXXXX.mjs")
720+ git show "$WORKFLOW_SHA:scripts/upstream-release/post-session-report.mjs" > "$REPORTER"
721+ echo "path=$REPORTER" >> "$GITHUB_OUTPUT"
722+
712723 # Dispatch runs do not support Claude's live tracking comments.
713- # Post explicit started/completed comments for reviewers instead .
724+ # Publish each final response explicitly after its session finishes .
714725 - name : Post skill-started comment
715726 if : github.event_name == 'workflow_dispatch' && steps.eff.outputs.number != ''
716727 env :
@@ -856,6 +867,20 @@ jobs:
856867 if : always() && steps.generation_token.outcome == 'success'
857868 run : git remote set-url origin "https://github.com/$GITHUB_REPOSITORY.git"
858869
870+ # Publish immediately: editorial overwrites the shared execution file.
871+ # Use the job token so reporting does not depend on session credentials.
872+ - name : Post generation report
873+ if : always() && steps.eff.outputs.number != '' && (steps.skill_gen.outcome == 'success' || steps.skill_gen.outcome == 'failure')
874+ continue-on-error : true
875+ env :
876+ REPORTER : ${{ steps.session_reporter.outputs.path }}
877+ EXECUTION_FILE : ${{ steps.skill_gen.outputs.execution_file }}
878+ PR_NUMBER : ${{ steps.eff.outputs.number }}
879+ SESSION : generation
880+ SESSION_OUTCOME : ${{ steps.skill_gen.outcome }}
881+ RUN_URL : ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
882+ run : node "$REPORTER"
883+
859884 # Capture skill_gen's execution stats BEFORE skill_review runs
860885 # and overwrites the shared execution-output JSON at the
861886 # canonical claude-code-action location. Lets us report
@@ -909,6 +934,17 @@ jobs:
909934 identity : upstream-release-docs
910935 domain : octo-sts.stacklok.dev
911936
937+ # A failure before editorial starts must not publish generation's
938+ # response a second time through the action's fallback file output.
939+ - name : Clear previous session output
940+ if : always() && steps.skill_gen.conclusion == 'success' && steps.review_token.outcome == 'success'
941+ env :
942+ EXECUTION_FILE : ${{ steps.skill_gen.outputs.execution_file }}
943+ run : |
944+ if [ -n "$EXECUTION_FILE" ]; then
945+ rm -f -- "$EXECUTION_FILE"
946+ fi
947+
912948 - name : Run docs-review on skill output (fresh context)
913949 id : skill_review
914950 if : always() && steps.skill_gen.conclusion == 'success' && steps.review_token.outcome == 'success'
@@ -1006,6 +1042,18 @@ jobs:
10061042 if : always() && steps.review_token.outcome == 'success'
10071043 run : git remote set-url origin "https://github.com/$GITHUB_REPOSITORY.git"
10081044
1045+ - name : Post editorial report
1046+ if : always() && steps.eff.outputs.number != '' && (steps.skill_review.outcome == 'success' || steps.skill_review.outcome == 'failure')
1047+ continue-on-error : true
1048+ env :
1049+ REPORTER : ${{ steps.session_reporter.outputs.path }}
1050+ EXECUTION_FILE : ${{ steps.skill_review.outputs.execution_file }}
1051+ PR_NUMBER : ${{ steps.eff.outputs.number }}
1052+ SESSION : editorial
1053+ SESSION_OUTCOME : ${{ steps.skill_review.outcome }}
1054+ RUN_URL : ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
1055+ run : node "$REPORTER"
1056+
10091057 # claude-code-action works in a sibling scratch checkout (the
10101058 # .claude-pr/ dir we gitignore) and pushes commits to origin
10111059 # directly, without advancing the outer workflow checkout's
0 commit comments