Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 2, 2025

  • Remove timestamp from CI branch name to use PR number only
  • Check if CI branch already exists before creating
  • Update existing branch if it already exists (force push)
  • Check if CI PR already exists before creating
  • Update existing PR instead of creating a new one
  • Update comments to reflect reuse behavior
  • Filter CI PRs by label to avoid selecting wrong PR
  • Ensure labels are present on both new and existing PRs
  • Fix API response data structure handling
  • Handle unlabeled existing PRs gracefully with title validation
  • Add documentation for label handling logic
  • Resolve merge conflicts with base PR (script extraction)
  • Apply all changes to new create-ci-pr.js script file

💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

@changeset-bot
Copy link

changeset-bot bot commented Dec 2, 2025

⚠️ No Changeset found

Latest commit: 0889038

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@vercel
Copy link
Contributor

vercel bot commented Dec 2, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
example-nextjs-workflow-turbopack Ready Ready Preview Comment Dec 2, 2025 6:53pm
example-nextjs-workflow-webpack Ready Ready Preview Comment Dec 2, 2025 6:53pm
example-workflow Ready Ready Preview Comment Dec 2, 2025 6:53pm
workbench-astro-workflow Error Error Dec 2, 2025 6:53pm
workbench-express-workflow Error Error Dec 2, 2025 6:53pm
workbench-hono-workflow Ready Ready Preview Comment Dec 2, 2025 6:53pm
workbench-nitro-workflow Ready Ready Preview Comment Dec 2, 2025 6:53pm
workbench-nuxt-workflow Ready Ready Preview Comment Dec 2, 2025 6:53pm
workbench-sveltekit-workflow Ready Ready Preview Comment Dec 2, 2025 6:53pm
workbench-vite-workflow Ready Ready Preview Comment Dec 2, 2025 6:53pm
workflow-docs Ready Ready Preview Comment Dec 2, 2025 6:53pm

@pranaygp
Copy link
Collaborator

pranaygp commented Dec 2, 2025

@copilot resolve merge conflicts

Copy link
Contributor Author

Copilot AI commented Dec 2, 2025

@copilot resolve merge conflicts

Merge conflicts resolved in commit 0889038.

The base PR #325 was updated to extract inline GitHub Action scripts into separate files. I've:

  • Merged the latest changes from PR Enable ci for external collaborators #325
  • Applied all my timestamp removal and PR reuse changes to the new .github/scripts/create-ci-pr.js file
  • Kept the workflow file using the extracted script references

All functionality is preserved with the same 1:1 PR relationship behavior.

if (existingPR.title.startsWith('[CI Test]')) {
// Use the existing PR and add the labels
ciPR = existingPR;
isNewPR = true; // Treat as new to ensure labels are added
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
isNewPR = true; // Treat as new to ensure labels are added
isNewPR = false; // This is an existing PR being reused, not a new one

When reusing an existing CI test PR without the 'ci-test' label but with the correct title, the isNewPR flag is incorrectly set to true, causing the comment to say "CI test created" instead of "CI test updated".

View Details

Analysis

Incorrect isNewPR flag causes misleading message for reused CI test PRs

What fails: When reusing an existing CI test PR that lacks the 'ci-test' label but has a title starting with '[CI Test]', the isNewPR flag is incorrectly set to true at line 54 of .github/scripts/create-ci-pr.js. This causes the user comment at line 75 to say "✅ CI test created" instead of "✅ CI test updated", which is misleading since the PR is being reused, not newly created.

How to reproduce:

  1. Trigger /run-ci on an external PR that creates a new CI test PR (branch: ci-test/{prNumber})
  2. The initial comment will correctly say "✅ CI test created"
  3. Manually remove the 'ci-test' label from the CI test PR
  4. Trigger /run-ci again on the same external PR
  5. The code will find the existing CI test PR without the label (line 31), verify it has the correct title (line 50), and reuse it (line 52)
  6. The isNewPR flag is set to true (line 54), causing the comment to incorrectly say "✅ CI test created" again

Expected: The message should say "✅ CI test updated" because the code path represents reusing an existing PR (line 52: ciPR = existingPR), not creating a new one. The labels are added automatically via the label-adding logic (lines 60-70), so setting isNewPR = true is unnecessary and incorrect.

Fix: Changed line 54 from isNewPR = true to isNewPR = false, with an updated comment clarifying that this code path represents an existing PR being reused. The label-adding logic continues to work correctly in all scenarios.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants