Commit 5517fcd
Cap skill turns/timeout + sync local HEAD after skill pushes (#783)
* Add turn/timeout caps and sync local HEAD after skill pushes
Three defensive additions to the upstream-release-docs pipeline.
## Sync local HEAD with skill-pushed commits
claude-code-action works in a sibling scratch checkout (the
`.claude-pr/` dir we gitignore) and pushes its commits to origin
without advancing the outer workflow checkout's HEAD. Every
subsequent step that reads local git state saw stale HEAD at the
pre-skill SHA.
Symptoms on PR #780:
- `skill_commits` counter reported 0 despite commit `d4b3c7c`
existing on the PR branch -- triggered the silent-run NOTE on
a run that wasn't actually silent.
- `autofix` early-exited with "No skill-touched files in scope"
because its `git diff BASELINE_SHA..HEAD` returned nothing.
41 unformatted files from the skill landed on CI and failed
the Lint and format checks job.
Fix: new step between `skill_review` and `skill_commits` that
runs `git fetch origin $HEAD_REF && git merge --ff-only`. Local
HEAD now reflects whatever the skill pushed, so downstream steps
see the truth.
## --max-turns caps
Per-session turn ceilings via claude_args:
- skill_gen: 500 (baselines: 89 silent → 397 full rebuild)
- skill_review: 30 (baseline: 4-5 turns every run)
Clips genuine runaway loops without interfering with legitimate
complex runs. Hitting a cap fails loudly; we raise deliberately
if a release genuinely needs more.
## timeout-minutes per step
Wall-clock ceilings:
- skill_gen: 45 min (observed: 15-22 min)
- skill_review: 10 min (observed: 1-2 min)
Kills a stuck process before it burns the full 90-min job budget.
## What this does NOT cover
- Legitimate-but-expensive runs (PR #780 at $27 is real work).
- Upstream Anthropic pricing changes.
- High-frequency workflow triggering.
For those: set a monthly spend cap at the Anthropic console.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* Fail loudly on sync-step errors (Copilot review)
Drops the `|| true` after `git merge --ff-only`. Silently
continuing on a failed sync reintroduces the exact
skill_commits=0 + autofix-skips-files bugs this step prevents.
A no-op fast-forward (local already at origin) still exits 0
cleanly, so the common case is unaffected. Only genuine
divergence or merge errors now fail the 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 b3b2ab5 commit 5517fcd
1 file changed
Lines changed: 48 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
514 | 514 | | |
515 | 515 | | |
516 | 516 | | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
517 | 522 | | |
518 | 523 | | |
519 | 524 | | |
| |||
542 | 547 | | |
543 | 548 | | |
544 | 549 | | |
| 550 | + | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
545 | 556 | | |
546 | 557 | | |
| 558 | + | |
547 | 559 | | |
548 | 560 | | |
549 | 561 | | |
| |||
678 | 690 | | |
679 | 691 | | |
680 | 692 | | |
| 693 | + | |
| 694 | + | |
| 695 | + | |
| 696 | + | |
| 697 | + | |
681 | 698 | | |
682 | 699 | | |
683 | 700 | | |
| |||
688 | 705 | | |
689 | 706 | | |
690 | 707 | | |
691 | | - | |
| 708 | + | |
| 709 | + | |
| 710 | + | |
692 | 711 | | |
693 | 712 | | |
| 713 | + | |
694 | 714 | | |
695 | 715 | | |
696 | 716 | | |
| |||
723 | 743 | | |
724 | 744 | | |
725 | 745 | | |
| 746 | + | |
| 747 | + | |
| 748 | + | |
| 749 | + | |
| 750 | + | |
| 751 | + | |
| 752 | + | |
| 753 | + | |
| 754 | + | |
| 755 | + | |
| 756 | + | |
| 757 | + | |
| 758 | + | |
| 759 | + | |
| 760 | + | |
| 761 | + | |
| 762 | + | |
| 763 | + | |
| 764 | + | |
| 765 | + | |
| 766 | + | |
| 767 | + | |
| 768 | + | |
| 769 | + | |
| 770 | + | |
| 771 | + | |
| 772 | + | |
726 | 773 | | |
727 | 774 | | |
728 | 775 | | |
| |||
0 commit comments