Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 2, 2025

Addresses review feedback to move inline JavaScript from trigger-ci.yml into separate script files for better maintainability and testability.

Changes

  • Created .github/scripts/ directory with four modular scripts:

    • check-permissions.js - Permission validation
    • post-unauthorized-comment.js - Error handling for unauthorized users
    • get-pr-details.js - PR metadata extraction
    • create-ci-pr.js - CI branch and draft PR creation
  • Updated workflow to use require() instead of inline code:

# Before
script: |
  try {
    const permission = await github.rest.repos.getCollaboratorPermissionLevel({
      owner: context.repo.owner,
      repo: context.repo.repo,
      username: context.actor
    });
    // ... 15+ lines of inline code
  } catch (error) {
    // ...
  }

# After
script: |
  const script = require('./.github/scripts/check-permissions.js');
  return await script({ github, context });

Follows the pattern established in vercel/vercel workflows.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

@changeset-bot
Copy link

changeset-bot bot commented Dec 2, 2025

⚠️ No Changeset found

Latest commit: 7aa6c98

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:42pm
example-nextjs-workflow-webpack Ready Ready Preview Comment Dec 2, 2025 6:42pm
example-workflow Ready Ready Preview Comment Dec 2, 2025 6:42pm
workbench-astro-workflow Error Error Dec 2, 2025 6:42pm
workbench-express-workflow Error Error Dec 2, 2025 6:42pm
workbench-hono-workflow Ready Ready Preview Comment Dec 2, 2025 6:42pm
workbench-nitro-workflow Ready Ready Preview Comment Dec 2, 2025 6:42pm
workbench-nuxt-workflow Ready Ready Preview Comment Dec 2, 2025 6:42pm
workbench-sveltekit-workflow Ready Ready Preview Comment Dec 2, 2025 6:42pm
workbench-vite-workflow Ready Ready Preview Comment Dec 2, 2025 6:42pm
workflow-docs Ready Ready Preview Comment Dec 2, 2025 6:42pm

Co-authored-by: pranaygp <1797812+pranaygp@users.noreply.github.com>
Co-authored-by: pranaygp <1797812+pranaygp@users.noreply.github.com>
Copilot AI changed the title [WIP] Address feedback on enabling CI for external collaborators Extract inline GitHub Action scripts to separate files Dec 2, 2025
Copilot AI requested a review from pranaygp December 2, 2025 18:44
@pranaygp pranaygp marked this pull request as ready for review December 2, 2025 18:45
@pranaygp pranaygp merged commit 8e0fe49 into pranaygp/external-collaborator-ci Dec 2, 2025
12 of 15 checks passed
@pranaygp pranaygp deleted the copilot/sub-pr-325-again branch December 2, 2025 18:45
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