Skip to content

CI: Potential fix for code scanning alert no. 10: Workflow does not contain permissions#13028

Draft
Baoyuantop wants to merge 1 commit intomasterfrom
alert-autofix-10
Draft

CI: Potential fix for code scanning alert no. 10: Workflow does not contain permissions#13028
Baoyuantop wants to merge 1 commit intomasterfrom
alert-autofix-10

Conversation

@Baoyuantop
Copy link
Contributor

Potential fix for https://github.com/apache/apisix/security/code-scanning/10

In general, the fix is to explicitly declare minimal GITHUB_TOKEN permissions for this workflow, either at the workflow root (applies to all jobs) or under the specific check-license job. Since there is only one job, either approach works; adding it at the workflow root is clear and future-proof if more jobs are added.

The best minimal fix without changing existing functionality is to add:

permissions:
  contents: read

near the top-level of the workflow, between name: and on: (or just above jobs:). The apache/skywalking-eyes action only needs to read repository contents to scan license headers; it does not need to write to the repo, issues, or PRs in the current snippet. Keeping contents: read ensures the workflow can still check out and read files while restricting any write capabilities. No imports or additional methods are needed, as this is purely a YAML configuration change.

Concretely, edit .github/workflows/license-checker.yml around lines 19–26 to insert a permissions: block at the root level.

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

…ontain permissions

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
@Baoyuantop Baoyuantop changed the title Potential fix for code scanning alert no. 10: Workflow does not contain permissions CI: Potential fix for code scanning alert no. 10: Workflow does not contain permissions Feb 25, 2026
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