Skip to content

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

Open
eriknordmark wants to merge 1 commit into
mainfrom
alert-autofix-2
Open

Potential fix for code scanning alert no. 2: Workflow does not contain permissions#89
eriknordmark wants to merge 1 commit into
mainfrom
alert-autofix-2

Conversation

@eriknordmark

Copy link
Copy Markdown
Contributor

Potential fix for https://github.com/lf-edge/eve-libs/security/code-scanning/2

Add a workflow-level permissions block in .github/workflows/build.yaml so all jobs inherit least-privilege token scopes unless overridden. The best minimal fix that preserves current behavior is:

  • contents: read (needed by actions/checkout and common read operations)

Place this block near the top level (after on: and before jobs:), so it applies to both report and build jobs without duplicating config. No imports, methods, or dependencies are needed.

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>
Signed-off-by: eriknordmark <erik@zededa.com>
@eriknordmark
eriknordmark marked this pull request as ready for review August 17, 2026 20:45
@eriknordmark

Copy link
Copy Markdown
Contributor Author

The yetus -1 is a line-numbering artifact, not a new problem: the two yamllint errors it counts as "new" are the pre-existing [commas] and [indentation] violations already in build.yaml, shifted from lines 23/26 to 26/29 by the three-line permissions: block this PR inserts (yetus's own pre-patch scan reports them at the old line numbers, and it scored them as "2 fixed" plus "2 new").

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