Skip to content

ci: declare workflow-level contents: read on 3 workflows#269

Merged
lumirlumir merged 1 commit into
eslint:mainfrom
arpitjain099:chore/declare-workflow-perms-readonly
Jun 13, 2026
Merged

ci: declare workflow-level contents: read on 3 workflows#269
lumirlumir merged 1 commit into
eslint:mainfrom
arpitjain099:chore/declare-workflow-perms-readonly

Conversation

@arpitjain099

Copy link
Copy Markdown
Contributor

Pins the default GITHUB_TOKEN to contents: read on 3 workflows in .github/workflows/ that don't call a GitHub API beyond the initial checkout.

Why

CVE-2025-30066 (March 2025 tj-actions/changed-files supply-chain compromise) exfiltrated GITHUB_TOKEN from workflow logs. Pinning per workflow caps runtime authority irrespective of the repo or org default, gives drift protection if the default ever widens, and is credited per-file by the OpenSSF Scorecard Token-Permissions check.

YAML validated locally with yaml.safe_load on each touched file.

@eslintbot eslintbot added this to Triage May 16, 2026
@github-project-automation github-project-automation Bot moved this to Needs Triage in Triage May 16, 2026
@lumirlumir lumirlumir moved this from Needs Triage to Triaging in Triage May 18, 2026

@lumirlumir lumirlumir left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

As mentioned in eslint/rewrite#452 (review), could you take a look at the CI failure?

@arpitjain099 arpitjain099 force-pushed the chore/declare-workflow-perms-readonly branch from ce8dc9b to 37f292e Compare May 19, 2026 12:09
@arpitjain099

Copy link
Copy Markdown
Contributor Author

Indent fix (4-space) + rebase on main pushed; same shape as the rewrite#452 fix. Let me know if anything else.

@lumirlumir

Copy link
Copy Markdown
Member

Thanks for the update. I think the CI failure isn’t related to this change, and it also fails on the main branch. I’ll open a separate PR to resolve it shortly.

@arpitjain099

Copy link
Copy Markdown
Contributor Author

Quick read on the CI failure - the failing job (ci-package-manager / pnpm-install) is hitting [ERR_PNPM_IGNORED_BUILDS] Ignored build scripts: yo@7.0.1. That's pnpm 10+ refusing to run yo's install-time build script by default. It's unrelated to the workflow-permissions diff in this PR (the failing step runs inside the upstream reusable workflow eslint/workflows/.github/workflows/ci-package-manager.yml, and it fails on main too with this config).

The fix would live in package.json on this repo - something like:

"pnpm": {
  "onlyBuiltDependencies": ["yo"]
}

Happy to roll that into this PR if you'd prefer one PR, or leave it as a separate small fix - your call. Other repos in the batch don't hit this since they don't pull in yeoman.

@lumirlumir

Copy link
Copy Markdown
Member

@arpitjain099 Thanks for looking into it. I opened a PR to resolve that issue about five days ago at #270, so let’s wait a bit for that PR to be merged :)

@lumirlumir

Copy link
Copy Markdown
Member

Could you rebase this branch once so that the CI failure is fixed?

Pins the default GITHUB_TOKEN to contents: read on workflows that don't
call a GitHub API beyond the initial checkout. Other workflows that need
write scopes are left implicit for a maintainer to declare.

Motivation: CVE-2025-30066 (March 2025 tj-actions/changed-files
compromise) exfiltrated GITHUB_TOKEN from workflow logs. Per-workflow
caps bound runtime authority irrespective of repo or org default,
give drift protection, and are credited per-file by the OpenSSF
Scorecard Token-Permissions check.

YAML validated locally with yaml.safe_load.

Signed-off-by: Arpit Jain <arpitjain099@gmail.com>
@arpitjain099 arpitjain099 force-pushed the chore/declare-workflow-perms-readonly branch from 37f292e to 3809c73 Compare June 10, 2026 01:06
@arpitjain099

Copy link
Copy Markdown
Contributor Author

Rebased onto main - the CI failure should be cleared now. Thanks @lumirlumir!

@lumirlumir lumirlumir left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM, thanks!

@lumirlumir lumirlumir merged commit 7224cf5 into eslint:main Jun 13, 2026
19 checks passed
@github-project-automation github-project-automation Bot moved this from Triaging to Complete in Triage Jun 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Complete

Development

Successfully merging this pull request may close these issues.

3 participants