Skip to content

Potential fix for code scanning alert no. 146: Workflow does not contain permissions#34

Merged
derekmisler merged 1 commit intomainfrom
alert-autofix-146
Feb 9, 2026
Merged

Potential fix for code scanning alert no. 146: Workflow does not contain permissions#34
derekmisler merged 1 commit intomainfrom
alert-autofix-146

Conversation

@derekmisler
Copy link
Contributor

Potential fix for https://github.com/docker/cagent-action/security/code-scanning/146

In general, the fix is to add an explicit permissions block that grants the minimal required scopes for the job. Here, the job just checks out the code and runs actionlint; it does not push changes, create issues, or modify pull requests, so contents: read is sufficient, and for extra safety we can set all permissions to none and override contents to read.

The single best fix with no behavior change is to add a permissions block either at the workflow root (before jobs:) or scoped to the actionlint job. To keep the change narrow and local, we’ll add it under jobs.actionlint, e.g.:

jobs:
  actionlint:
    permissions:
      contents: read
    runs-on: ubuntu-latest
    ...

This restricts the GITHUB_TOKEN used in this job to read-only repository contents. No imports or external definitions are needed beyond this YAML change. Only .github/workflows/lint-actions.yml is modified, near line 18–20.

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

…ain permissions

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
Signed-off-by: Derek Misler <derekmisler@gmail.com>
@derekmisler derekmisler marked this pull request as ready for review February 9, 2026 16:01
@derekmisler derekmisler requested a review from a team as a code owner February 9, 2026 16:01
@derekmisler derekmisler merged commit b2ad694 into main Feb 9, 2026
10 checks passed
@derekmisler derekmisler deleted the alert-autofix-146 branch February 9, 2026 17:34
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.

2 participants