Skip to content

Commit 74b532c

Browse files
rdimitrovclaude
andauthored
Add skill tracking + silent-run feedback for workflow_dispatch (#778)
* Add skill-started + skill-completed PR comments for workflow_dispatch claude-code-action@v1 rejects track_progress: true on workflow_dispatch events, so manual retries and bootstrap dispatches leave no real-time signal on the PR that the skill is running -- reviewers had to hunt through the Actions tab to see progress. On pull_request runs the action posts its own tracking comment, so this gap only affects workflow_dispatch. Two workflow_dispatch-only comments: - Before skill_gen: a "Claude Opus is generating docs updates for <project> <tag>. Follow progress: <run URL>" placeholder. Static but enough to signal "yes it started". - After Augment PR body: a run summary with skill_gen / skill_review / autofix conclusions and a link to the run for the Claude Code Report. Runs even if earlier steps failed so reviewers can see which step died. Both are gated on `github.event_name == 'workflow_dispatch'` to avoid duplicating the action's own tracking on Renovate-opened PRs. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * Flag silent skill runs in PR body + dispatch summary Companion to the tracking comments: when the skill concludes successfully but produces zero commits, the PR body previously read as if content was added. Reviewers had no way to distinguish "skill ran silently" from "skill produced stuff". Adds: - A new step that rev-counts commits between pre_skill SHA and HEAD. Output exposed as steps.skill_commits.outputs.count. - A [!NOTE] block in the PR body when SKILL_COMMIT_COUNT=0 and no NO_CHANGES.md was written. Lists the three likely causes (docs already ahead of pin; no doc-relevant release; skill's verification matched existing prose). - A row in the workflow_dispatch summary comment showing the commit count. Surfaced by the e2e test on PR #777: the skill ran to success but produced nothing because main was already ahead of the pinned scratch branch. PR body looked like a normal augmented PR. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * Address Copilot review feedback on #778 Two fixes from Copilot's line-level comments: 1. Pre-skill placeholder comment step is best-effort. Was previously unguarded -- a transient gh failure (rate limit, API hiccup, permission edge case) would abort the workflow before skill_gen ran. Matches the `|| true` pattern already used by the post-run summary comment and the augmentation-failure comment. 2. Silent-run [!NOTE] is gated on BOTH skill steps having succeeded. The note claims "ran to success"; previously the condition only checked SKILL_COMMIT_COUNT=0 and NOTE_BLOCK empty, which could trigger the note even if skill_review had failed. Now requires steps.skill_gen.conclusion == 'success' AND steps.skill_review.conclusion == 'success'. Partial failures are already covered by the separate augmentation-failure comment step. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 47b67d5 commit 74b532c

1 file changed

Lines changed: 113 additions & 0 deletions

File tree

.github/workflows/upstream-release-docs.yml

Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -481,6 +481,33 @@ jobs:
481481
")
482482
echo "docs_paths=$HINTS" >> "$GITHUB_OUTPUT"
483483
484+
# claude-code-action@v1 rejects track_progress: true on
485+
# workflow_dispatch events with "track_progress is only
486+
# supported for events: pull_request, issue_comment, ...".
487+
# That means on manual retries and bootstrap dispatches, the
488+
# PR gets no real-time "Claude is working on it" comment from
489+
# the action -- a reviewer watching the PR has no visible
490+
# signal that the skill is actually running. Post a static
491+
# placeholder comment ourselves, scoped to workflow_dispatch
492+
# runs so we don't duplicate the action's own tracking on
493+
# normal Renovate-opened PRs.
494+
- name: Post skill-started comment (workflow_dispatch only)
495+
if: github.event_name == 'workflow_dispatch' && steps.eff.outputs.number != ''
496+
env:
497+
PR_NUMBER: ${{ steps.eff.outputs.number }}
498+
RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
499+
PROJECT_ID: ${{ steps.detect.outputs.id }}
500+
NEW_TAG: ${{ steps.detect.outputs.new_tag }}
501+
run: |
502+
# `|| true` so a transient gh failure (rate limit, API
503+
# hiccup, permission edge case) doesn't abort the run
504+
# before skill_gen gets to execute. The comment is a
505+
# visibility aid, not load-bearing. Matches the pattern
506+
# used by the other gh pr comment steps in this workflow.
507+
gh pr comment "$PR_NUMBER" --body "Claude Opus is generating docs updates for \`$PROJECT_ID\` \`$NEW_TAG\`. Follow progress in the workflow run: $RUN_URL
508+
509+
(This comment replaces the real-time tracking comment claude-code-action posts on Renovate-opened PRs, which isn't supported on \`workflow_dispatch\` events.)" || true
510+
484511
# Invocation 1: generation. Runs /upstream-release-docs end-to-
485512
# end (all 6 phases, including the skill's own internal
486513
# docs-review in Phase 5). Uses Opus 4.7 — generation benefits
@@ -668,6 +695,26 @@ jobs:
668695
if they exist -- they're signal files handed off to the
669696
next workflow step, not part of the docs.
670697
698+
# Count the commits the skill itself added between pre_skill
699+
# and now. Zero commits means skill_gen and skill_review both
700+
# concluded there was nothing to change -- e.g. because main
701+
# already has the content for this release (a re-run or test
702+
# after the same content was merged via a different PR), or
703+
# because the release genuinely had no doc-relevant impact
704+
# but the skill didn't produce NO_CHANGES.md. Either way the
705+
# resulting PR is silent and reviewers can't tell that from
706+
# a successful run with content -- we emit a visible note in
707+
# the PR body when this is the case.
708+
- name: Count skill commits
709+
id: skill_commits
710+
if: always() && steps.skill_gen.conclusion == 'success'
711+
env:
712+
BASELINE_SHA: ${{ steps.pre_skill.outputs.sha }}
713+
run: |
714+
COUNT=$(git rev-list "$BASELINE_SHA..HEAD" --count)
715+
echo "count=$COUNT" >> "$GITHUB_OUTPUT"
716+
echo "Skill produced $COUNT commit(s) between pre_skill and now."
717+
671718
# Auto-apply the same formatters the project's pre-commit hook
672719
# runs, scoped to the files the skill touched. The skill's
673720
# sandbox doesn't include npm run prettier/eslint, so without
@@ -835,6 +882,9 @@ jobs:
835882
COMPARE_OK: ${{ steps.reviewers.outputs.compare_ok }}
836883
MENTION_BLOCK: ${{ steps.reviewers.outputs.mention_block }}
837884
ASSIGN_LIST: ${{ steps.reviewers.outputs.list }}
885+
SKILL_COMMIT_COUNT: ${{ steps.skill_commits.outputs.count }}
886+
GEN_CONCLUSION: ${{ steps.skill_gen.conclusion }}
887+
REVIEW_CONCLUSION: ${{ steps.skill_review.conclusion }}
838888
run: |
839889
START='<!-- upstream-release-docs:start -->'
840890
END='<!-- upstream-release-docs:end -->'
@@ -856,6 +906,38 @@ jobs:
856906
echo "$NOTE_BLOCK"
857907
echo ""
858908
fi
909+
# When BOTH skill invocations ran to success but produced
910+
# zero commits between them, we have no NOTE_BLOCK (no
911+
# NO_CHANGES.md), no content for reviewers to look at, and
912+
# a PR body that otherwise reads as if content was added.
913+
# Surface the silence explicitly -- but ONLY when both
914+
# skill steps actually succeeded, so we don't claim "ran
915+
# to success" on behalf of a run that had a mid-flight
916+
# failure. Partial failures are covered by the separate
917+
# augmentation-failure comment step at the end.
918+
if [ "$SKILL_COMMIT_COUNT" = "0" ] \
919+
&& [ -z "$NOTE_BLOCK" ] \
920+
&& [ "$GEN_CONCLUSION" = "success" ] \
921+
&& [ "$REVIEW_CONCLUSION" = "success" ]; then
922+
echo "> [!NOTE]"
923+
echo "> The \`upstream-release-docs\` skill ran to success but"
924+
echo "> produced no content commits on this PR. Likely causes:"
925+
echo ">"
926+
echo "> - The docs already cover this release (e.g. this PR"
927+
echo "> was dispatched after an earlier PR for the same"
928+
echo "> tag had merged, or \`main\` is already ahead of the"
929+
echo "> pinned base)."
930+
echo "> - The release genuinely had no doc-relevant changes"
931+
echo "> but the skill did not write \`NO_CHANGES.md\` (which"
932+
echo "> would have triggered the standard 'no changes'"
933+
echo "> note above)."
934+
echo "> - The skill's source verification concluded the"
935+
echo "> existing prose already matches upstream behavior."
936+
echo ">"
937+
echo "> Only the version bump and any refreshed reference"
938+
echo "> assets are included in this PR."
939+
echo ""
940+
fi
859941
if [ -n "$AUTOGEN_NOTE" ]; then
860942
echo "$AUTOGEN_NOTE"
861943
echo ""
@@ -907,6 +989,37 @@ jobs:
907989
908990
gh pr edit "$PR_NUMBER" --body-file /tmp/pr-body.md
909991
992+
# Post-run summary for workflow_dispatch, mirroring the pre-run
993+
# placeholder comment above. Gives reviewers a single point in
994+
# the PR timeline that says "here's what happened, and where to
995+
# see the full report" without them having to hunt through the
996+
# Actions tab. Skipped on pull_request runs where claude-code-
997+
# action already posts its own completion comment.
998+
- name: Post skill-completed summary (workflow_dispatch only)
999+
if: always() && github.event_name == 'workflow_dispatch' && steps.eff.outputs.number != ''
1000+
env:
1001+
PR_NUMBER: ${{ steps.eff.outputs.number }}
1002+
RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
1003+
PROJECT_ID: ${{ steps.detect.outputs.id }}
1004+
NEW_TAG: ${{ steps.detect.outputs.new_tag }}
1005+
GEN_CONCLUSION: ${{ steps.skill_gen.conclusion }}
1006+
REVIEW_CONCLUSION: ${{ steps.skill_review.conclusion }}
1007+
AUTOFIX_CONCLUSION: ${{ steps.autofix.conclusion }}
1008+
SKILL_COMMIT_COUNT: ${{ steps.skill_commits.outputs.count }}
1009+
run: |
1010+
gh pr comment "$PR_NUMBER" --body "## Upstream-release-docs run summary
1011+
1012+
Project: \`$PROJECT_ID\` at tag \`$NEW_TAG\`
1013+
1014+
| Step | Conclusion |
1015+
| --- | --- |
1016+
| Generation (\`skill_gen\`) | \`${GEN_CONCLUSION:-(not run)}\` |
1017+
| Editorial review (\`skill_review\`) | \`${REVIEW_CONCLUSION:-(not run)}\` |
1018+
| Autofix (prettier/eslint) | \`${AUTOFIX_CONCLUSION:-(not run)}\` |
1019+
| Skill commits produced | \`${SKILL_COMMIT_COUNT:-?}\` |
1020+
1021+
Full report and Claude's step-by-step log: $RUN_URL" || true
1022+
9101023
- name: Comment on augmentation failure
9111024
# Runs only when a preceding step failed. Comments a retry
9121025
# pointer on the PR so a human can see the run URL.

0 commit comments

Comments
 (0)