diff --git a/git-workflows/skills/rebase-pr/SKILL.md b/git-workflows/skills/rebase-pr/SKILL.md index 0955862..0255bee 100644 --- a/git-workflows/skills/rebase-pr/SKILL.md +++ b/git-workflows/skills/rebase-pr/SKILL.md @@ -178,3 +178,17 @@ Skip Steps 1–6. Go directly to Step 7 cleanup. **merge-base --is-ancestor exits non-zero:** Main moved while you were waiting for CI. Return to Step 2, re-sync main, re-fetch branch, re-rebase, force-push again, wait for CI, then retry merge. + +### Pre-Push Hook Auto-Fixes Files + +**Detection**: `git push` fails, hook output shows "files were modified by this hook" + +**Action**: Commit the auto-fixed files and retry the push: + +```bash +git add -A +git commit -m "style: apply pre-push hook auto-fixes" +git push --force-with-lease origin {branch} +``` + +This commonly occurs with release-please CHANGELOG.md entries that don't conform to markdownlint rules. diff --git a/github-workflows/skills/resolve-pr-threads/SKILL.md b/github-workflows/skills/resolve-pr-threads/SKILL.md index 460609b..6be2925 100644 --- a/github-workflows/skills/resolve-pr-threads/SKILL.md +++ b/github-workflows/skills/resolve-pr-threads/SKILL.md @@ -78,7 +78,7 @@ gh api "repos/{owner}/{repo}/issues/{number}/comments?since={lastCommitDate}" #### Step 1d: Fetch Review Body Comments Since Last Commit ```bash -gh api "repos/{owner}/{repo}/pulls/{number}/reviews" --jq '[.[] | select(.submitted_at > "{lastCommitDate}" and .body != "") | {id, body, author: .user.login, submitted_at}]' +gh api "repos/{owner}/{repo}/pulls/{number}/reviews" --jq '[.[] | select(.submitted_at > "{lastCommitDate}" and (.body | length > 0)) | {id, body, author: .user.login, submitted_at}]' ``` ### Step 2a: Group Related Threads @@ -212,3 +212,4 @@ Omit "Threads:" when zero threads; omit "Comments:" when zero comments. | REST reply fails | Invalid `databaseId` or permissions | Verify numeric databaseId (not node ID) and ensure token has required repo permissions (403 = permission issue) | | `since` filter returns all comments | Invalid date format | Verify ISO 8601 format | | Reviews endpoint returns empty | No reviews submitted | Proceed with threads only | +| `\!` in jq expression | Claude Code Bash escapes `!` | Use `(.x == y | not)` or `.x | length > 0` instead of `!=` | diff --git a/github-workflows/skills/resolve-pr-threads/rest-api-patterns.md b/github-workflows/skills/resolve-pr-threads/rest-api-patterns.md index af87758..b392028 100644 --- a/github-workflows/skills/resolve-pr-threads/rest-api-patterns.md +++ b/github-workflows/skills/resolve-pr-threads/rest-api-patterns.md @@ -73,7 +73,7 @@ Returns array of comments posted after the specified timestamp. ### Fetch Review Body Comments Since Last Commit ```bash -gh api "repos/{owner}/{repo}/pulls/{number}/reviews" --jq '[.[] | select(.submitted_at > "{lastCommitDate}" and .body != "") | {id, body, author: .user.login, submitted_at}]' +gh api "repos/{owner}/{repo}/pulls/{number}/reviews" --jq '[.[] | select(.submitted_at > "{lastCommitDate}" and (.body | length > 0)) | {id, body, author: .user.login, submitted_at}]' ``` The `--jq` filter is required because the reviews endpoint does not support server-side `?since=` filtering. diff --git a/github-workflows/skills/trigger-ai-reviews/SKILL.md b/github-workflows/skills/trigger-ai-reviews/SKILL.md index 48261f0..0d92ec1 100644 --- a/github-workflows/skills/trigger-ai-reviews/SKILL.md +++ b/github-workflows/skills/trigger-ai-reviews/SKILL.md @@ -37,10 +37,7 @@ Verify the PR exists and is open: ```bash STATE=$(gh pr view "$PR_NUMBER" --json state --jq '.state') -if [ "$STATE" != "OPEN" ]; then - echo "PR #$PR_NUMBER is $STATE — only open PRs can be reviewed" - exit 1 -fi +[ "$STATE" = "OPEN" ] || { echo "PR #$PR_NUMBER is $STATE — only open PRs can be reviewed"; exit 1; } ``` ## Step 2: Trigger Claude