Skip to content

ci: apply least-privilege permissions to all workflows#578

Merged
JasonXuDeveloper merged 4 commits into
masterfrom
ci/least-privilege-permissions
Jan 26, 2026
Merged

ci: apply least-privilege permissions to all workflows#578
JasonXuDeveloper merged 4 commits into
masterfrom
ci/least-privilege-permissions

Conversation

@JasonXuDeveloper
Copy link
Copy Markdown
Owner

Summary

  • Move write permissions from workflow-level to job-level to satisfy OpenSSF Scorecard Token-Permissions check
  • This follows the principle of least privilege - workflows default to read-all, and only specific jobs that need write access declare it

Changed Workflows

Workflow Change
claude.yml id-token: write moved to job level
claude-code-review.yml Consistent read-all at workflow level
codeql.yml security-events: write moved to job level
labeler.yml pull-requests: write moved to job level
pr-tests.yml pull-requests: write, statuses: write moved to job level
release.yml contents: write already at job level, workflow changed to read-all
stale.yml issues: write, pull-requests: write moved to job level
unity-tests.yml checks: write moved to job level

Impact

This should resolve the Token-Permissions alerts in the OpenSSF Scorecard, improving the security score.

Test plan

  • All modified workflows should continue to function correctly
  • OpenSSF Scorecard should show improved Token-Permissions score after merge

🤖 Generated with Claude Code

Move write permissions from workflow-level to job-level to satisfy
OpenSSF Scorecard Token-Permissions check. This follows the principle
of least privilege - workflows default to read-all, and only specific
jobs that need write access declare it.

Changed workflows:
- claude.yml: id-token: write moved to job level
- claude-code-review.yml: consistent read-all at workflow level
- codeql.yml: security-events: write moved to job level
- labeler.yml: pull-requests: write moved to job level
- pr-tests.yml: pull-requests: write, statuses: write moved to job level
- release.yml: contents: write already at job level, workflow to read-all
- stale.yml: issues: write, pull-requests: write moved to job level
- unity-tests.yml: checks: write moved to job level

Signed-off-by: Jason Xu <jasonxudeveloper@gmail.com>
Signed-off-by: JasonXuDeveloper - 傑 <jason@xgamedev.net>
@github-actions github-actions Bot added the ci label Jan 26, 2026
…tion

Signed-off-by: JasonXuDeveloper - 傑 <jason@xgamedev.net>
@claude
Copy link
Copy Markdown

claude Bot commented Jan 26, 2026

Code review

No issues found. Checked for bugs and CLAUDE.md compliance.

GitHub Actions doesn't allow job-level permissions to exceed
workflow-level permissions. These workflows need write permissions
at workflow level because multiple jobs require them.

Signed-off-by: Jason Xu <jasonxudeveloper@gmail.com>
Signed-off-by: JasonXuDeveloper - 傑 <jason@xgamedev.net>
- Rename skip-tests job to 'Skip Unity Tests' for clarity
- Add commit status creation when tests are skipped
- Both run and skip scenarios now create 'Unity Tests' status

This ensures the required status check works regardless of whether
tests actually run or are skipped due to no relevant changes.

Signed-off-by: Jason Xu <jasonxudeveloper@gmail.com>
Signed-off-by: JasonXuDeveloper - 傑 <jason@xgamedev.net>
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jan 26, 2026

Unity Test Results

EditMode: All tests passed
PlayMode: All tests passed

Unity Version: 2022.3.55f1
Project Path: UnityProject

✅ All tests passed! The PR is ready for review.

View workflow run

Click here to view the full workflow run

@JasonXuDeveloper JasonXuDeveloper merged commit 0838b30 into master Jan 26, 2026
19 checks passed
@JasonXuDeveloper JasonXuDeveloper deleted the ci/least-privilege-permissions branch January 26, 2026 07:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant