Skip to content

Conversation

@lenucksi
Copy link
Member

Potential fix for https://github.com/InnerSourceCommons/InnerSourcePatterns/security/code-scanning/5

To fix the problem, we should add a permissions block to the workflow file .github/workflows/book.yml. The block should be added at the workflow root (top-level, after name: and before jobs:), so the permissions apply to all jobs in the workflow. The least privilege required is contents: write so the job can push changes to the repo (required by the auto-commit step). Other permissions (such as pull-requests: write) are not required for this workflow, as it does not modify pull requests or other resources. The block should be added after the workflow name: and before the jobs: key (best practice is before any uses of the jobs).

No imports or additional methods/definitions are needed; it's a change to the workflow configuration only.

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>
@spier
Copy link
Member

spier commented Dec 16, 2025

hi @lenucksi. As this was suggested by Copilot, how would you go about testing if this works?

We could merge to main, and then check if (a) the workflow still runs, and (b) the code scanning alert goes away?
And if something breaks, we roll back?

I don't know of other ways to test github actions locally.

@spier spier added the Type - Maintenance / Cleanup Maintaining / cleaning the repo is the main focus of this issue / PR label Dec 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Type - Maintenance / Cleanup Maintaining / cleaning the repo is the main focus of this issue / PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants