Skip to content

Conversation

franky47
Copy link
Member

@franky47 franky47 commented Aug 30, 2025

Objective is to reduce the potential attack surface for token leaks & GHA misuse.

  • (GitHub setting) Changed GITHUB_TOKEN permissions to be read-only by default
  • (GitHub setting) Disallowed GHA to create or approve PRs.
  • (GitHub setting) Require approval for all external contributors (not just first-time)
  • Remove ship-it (move master to next, unused)
  • Remove snapshot deployment (pkg.pr.new is a much better DX)
  • Update linked issues milestones when PR is merged
  • Simplify logic for pkg.pr.new trigger (use on.pull_request.paths, and remove approval-based trigger)
  • Validate SemVer inputs for "Check against Next.js version" & "Analyse Next.js version" (without arbitrary injection)
  • Validate PR titles with Node.js to prevent arbitrary shell injection

Setting up proper OIDC trusted publishing for NPM will require semantic-release to have official support.

Resources:

Thanks @ciffelia for the tips!

Closes #1106.

Copy link

vercel bot commented Aug 30, 2025

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

Project Deployment Preview Comments Updated (UTC)
nuqs Ready Ready Preview Comment Aug 31, 2025 11:20am

@franky47 franky47 added the internal Internal issues & discussions label Aug 30, 2025
@franky47 franky47 added this to the 🪵 Backlog milestone Aug 30, 2025
Use the on.pull_request.paths to filter out relevant PRs, and trigger only on:
- PRs by maintainers
- PRs labeled with `deploy:preview`
@franky47 franky47 marked this pull request as ready for review August 30, 2025 20:46
@franky47 franky47 added deploy:preview Deploy a preview version of this PR on pkg.pr.new and removed deploy:preview Deploy a preview version of this PR on pkg.pr.new labels Aug 30, 2025
@franky47 franky47 requested a review from Copilot August 30, 2025 20:47
Copilot

This comment was marked as outdated.

Copilot

This comment was marked as outdated.

@franky47 franky47 requested a review from Copilot August 31, 2025 07:29
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR removes risky GitHub Actions workflows to reduce the potential attack surface for token leaks and GHA misuse. The changes align with security best practices by eliminating workflows that could pose security risks while simplifying and improving the remaining automation.

  • Completely removes snapshot release and ship-it workflows that required elevated permissions
  • Simplifies pkg.pr.new workflow by removing approval-based triggers and using path-based filtering
  • Enhances milestone automation with better error handling and support for updating linked issues

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
.github/workflows/snapshot-release.yml Removes entire snapshot deployment workflow that used NPM tokens
.github/workflows/ship-it.yml Removes workflow that required PAT tokens for branch management
.github/workflows/pr-base-enforcement.yml Updates comment message to clarify PR reopening requirement
.github/workflows/pkg.pr.new.yml Simplifies trigger logic by removing approval-based deployment and using path filtering
.github/workflows/milestone-automation.yml Adds comprehensive linked issues milestone updating with error handling

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

To avoid invalid expansions into arbitrary commands
@franky47 franky47 changed the title chore: Remove risky workflows bypass" && echo 'shell' && echo "chore: Securing workflows Aug 31, 2025
@franky47 franky47 changed the title bypass" && echo 'shell' && echo "chore: Securing workflows bypass" && echo 'test 2' && echo "chore: Securing workflows Aug 31, 2025
@franky47 franky47 changed the title bypass" && echo 'test 2' && echo "chore: Securing workflows bypass" && echo 'test 3' && echo "chore: Securing workflows Aug 31, 2025
@franky47 franky47 changed the title bypass" && echo 'test 3' && echo "chore: Securing workflows chore: Securing workflows Aug 31, 2025
@franky47 franky47 changed the title chore: Securing workflows chore: Securing workflows 2 Aug 31, 2025
@franky47 franky47 force-pushed the chore/workflow-trimdown branch from 64198d4 to 2632fe2 Compare August 31, 2025 11:18
@franky47 franky47 changed the title chore: Securing workflows 2 chore: Securing workflows Aug 31, 2025
@franky47 franky47 merged commit 01a5c83 into next Aug 31, 2025
54 checks passed
@franky47 franky47 deleted the chore/workflow-trimdown branch August 31, 2025 11:21
Copy link

🎉 This PR is included in version 2.6.0-beta.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
internal Internal issues & discussions released on @beta
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Change linked issues' milestone when merging a PR
1 participant