Skip to content

Potential fix for code scanning alert no. 1: Workflow does not contain permissions - #49

Merged
xiwenc merged 1 commit into
mainfrom
alert-autofix-1
Jul 30, 2025
Merged

Potential fix for code scanning alert no. 1: Workflow does not contain permissions#49
xiwenc merged 1 commit into
mainfrom
alert-autofix-1

Conversation

@xiwenc

@xiwenc xiwenc commented Jul 30, 2025

Copy link
Copy Markdown
Member

Potential fix for https://github.com/mxlint/mxlint-cli/security/code-scanning/1

To fix the problem, we should add a permissions block to the workflow file .github/workflows/release.yml. This block can be added at the top level (applies to all jobs) or at the job level (applies only to the specific job). Since the workflow only has one job, either location is acceptable, but top-level is preferred for clarity and future extensibility. The minimal starting point is contents: read, but since the workflow uses a release action, it may need contents: write to create or update releases and upload assets. Therefore, set contents: write at the workflow level. No other permissions are required unless the workflow interacts with issues or pull requests, which it does not.

Required changes:

  • Add a permissions block at the top level of .github/workflows/release.yml (after name: and before on:).
  • Set contents: write as the value.

Suggested fixes powered by Copilot Autofix. Review carefully before merging.

…n permissions

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
@xiwenc
xiwenc marked this pull request as ready for review July 30, 2025 09:59
@xiwenc
xiwenc merged commit 6686abd into main Jul 30, 2025
7 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