Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions .github/workflows/claude-copy-to-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ jobs:
if: |
github.event_name == 'issue_comment' &&
github.event.issue.pull_request &&
github.event.comment.user.login != 'svcnvidia-nemo-ci' &&
Comment thread
balasaajay marked this conversation as resolved.
contains(github.event.comment.body, '/claude copy')
runs-on: ubuntu-latest
permissions:
Expand All @@ -28,7 +29,7 @@ jobs:
run: |
PERMISSION=$(gh api repos/$REPO/collaborators/$COMMENTER/permission --jq .permission)
if [[ "$PERMISSION" != "admin" && "$PERMISSION" != "write" ]]; then
gh pr comment $PR_NUMBER --repo $REPO --body "❌ You do not have write access to use \`/claude copy\`."
gh pr comment $PR_NUMBER --repo $REPO --body "❌ You do not have write access to use the Claude copy command."
exit 1
fi

Expand All @@ -39,12 +40,12 @@ jobs:
PR_MERGED=$(echo "$PR_JSON" | jq -r .mergedAt)

if [ "$PR_BASE" = "main" ]; then
gh pr comment $PR_NUMBER --repo $REPO --body "❌ This PR already targets \`main\`. \`/claude copy\` only works on PRs targeting non-main branches."
gh pr comment $PR_NUMBER --repo $REPO --body "❌ This PR already targets \`main\`. The Claude copy command only works on PRs targeting non-main branches."
exit 1
fi

if [ "$PR_MERGED" = "null" ] || [ -z "$PR_MERGED" ]; then
gh pr comment $PR_NUMBER --repo $REPO --body "❌ This PR has not been merged yet. \`/claude copy\` only works on merged PRs."
gh pr comment $PR_NUMBER --repo $REPO --body "❌ This PR has not been merged yet. The Claude copy command only works on merged PRs."
exit 1
fi

Expand Down Expand Up @@ -110,7 +111,7 @@ jobs:
--base main \
--head copy-pr-${PR_NUMBER}-to-main \
--title "[Copy to main] <original PR title>" \
--body "🤖 **This PR was auto-generated by Claude** via the \`/claude copy\` command.\n\nCherry-picked from #${PR_NUMBER}.\n\n---\n\n<original PR body>"
--body "🤖 **This PR was auto-generated by Claude** via the Claude copy workflow.\n\nCherry-picked from #${PR_NUMBER}.\n\n---\n\n<original PR body>"

8. Comment on the original PR with a link to the newly created PR.

Expand Down
Loading