Skip to content

CI: release workflow grants write permissions to the release job only - #4048

Merged
FredApps merged 2 commits into
mainfrom
sonar/release-job-permissions
Nov 10, 2026
Merged

FredApps merged 2 commits into
mainfrom
sonar/release-job-permissions

Conversation

@FredApps

@FredApps FredApps commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

SonarCloud: githubactions:S8233 (AaGVc9qg7JDpWu2qdxdT, AaF2M3jggfhezIKm7sGd)

Problem

release.yml grants contents: write and packages: write at workflow level. SonarCloud reports both lines as githubactions:S8233 ("Move this write permission from workflow level to job level"); they count toward the failing new_security_rating condition of the quality gate. credits and git-sources already set their own read-only permissions, so only the release job uses the write grant.

Change

  • Workflow-level permissions is now {}.
  • The release job (the call to craft-common-actions/.github/workflows/release.yml) declares contents: write and packages: write, the same grant it had before.

Not in this PR: the other open LightCraft Sonar findings (Python tool path/command findings, which are proposed as false positives in SonarCloud, and code smells).

How it was checked

  • actionlint .github/workflows/release.yml: clean
  • cargo xtask ci: not run, workflow-only change
  • An actual release run: not run. The called workflow gets the same contents/packages grant as before; the first push to release (or a workflow_dispatch test run) confirms it.

Merging

Summary by CodeRabbit

  • Chores
    • Limited release write permissions to the release job; other workflow jobs no longer receive them by default.

@coderabbitai

coderabbitai Bot commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The release workflow now defaults to no permissions. The release job explicitly receives contents: write and packages: write.

Changes: Release workflow permissions

Layer / File(s) Summary
Set default and release-job permissions
.github/workflows/release.yml
The workflow defaults to no permissions. The release job receives contents: write and packages: write.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Change: Other

Suggested reviewers: dylanmtaylor

Merge Risk: Minimal · up to 20202

The permission change appears mergeable after normal checks: write access is limited to the release job without removing the other jobs’ declared access.

Pre-merge checks: Passed 5

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly summarizes the main change: write permissions are limited to the release job.
Docstring Coverage Passed No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 0 functions across 0 files. (1 skipped: 1 unsupported.)

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between e60a725 and 202021d.

Files selected for processing: 1

  • .github/workflows/release.yml

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

@FredApps

Copy link
Copy Markdown
Contributor Author

CI diagnosis: the only failing check is sonarcloud / SonarCloud Scan. Tests built and ran; the scan job then failed at llvm-profdata merge with:

profraw/shard-8-12042-6616866415804224847_0.profraw: invalid instrumentation profile data (file header is corrupt)
error: no profile can be merged

This PR only tightens write permissions on the release workflow, so it should not affect coverage profiles. The same "no profile can be merged" failure has already shown up as a flake on main (failed on 9 Nov, later main scans succeeded). I have rerun the failed job on run 42796978997.

@FredApps

Copy link
Copy Markdown
Contributor Author

Follow-up: the rerun of only the failed scan job hit the same corrupt profile (profraw/shard-8-12042-6616866415804224847_0.profraw) because it reused the original test artifacts. I have now rerun the whole SonarCloud workflow so the test shards regenerate the profiles.

@FredApps
FredApps marked this pull request as ready for review November 10, 2026 18:33
@sonarqubecloud

Copy link
Copy Markdown

@FredApps
FredApps merged commit b188295 into main Nov 10, 2026
20 checks passed
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.

1 participant