Skip to content

fix for code scanning alert: Workflow does not contain permissions#2

Merged
ron-tsarevsky merged 7 commits intomainfrom
workflow-permissions
Sep 10, 2025
Merged

fix for code scanning alert: Workflow does not contain permissions#2
ron-tsarevsky merged 7 commits intomainfrom
workflow-permissions

Conversation

@ron-tsarevsky
Copy link
Contributor

Potential fix for https://github.com/de-id/ffmpeg-kit/security/code-scanning/37

To fix the problem, we should explicitly declare the permissions: key at the workflow root (so it applies to all jobs, unless overridden), specifying only the minimal access needed for this workflow. At a minimum, CodeQL suggests contents: read, but because the workflow creates releases (softprops/action-gh-release) and uploads artifacts, we likely need additional permissions:

  • contents: write (for creating releases/assets)
  • actions: write (for uploading artifacts, though upload-artifact does not require this)
  • If we do not touch issues or PRs, avoid those permissions.

The best change is to add the following block just after the workflow name and before on: (so it covers all jobs in the workflow):

permissions:
  contents: write

If you want to start with the most restrictive and only escalate if you discover errors, you can use contents: read initially. However, the action-gh-release will require write on contents to create releases. So contents: write is correct for this workflow.

Only the top region of .github/workflows/android-build-scripts-did.yml needs to be changed.


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

ron-tsarevsky and others added 7 commits September 10, 2025 16:21
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
@ron-tsarevsky ron-tsarevsky changed the title Potential fix for code scanning alert no. 37: Workflow does not contain permissions fix for code scanning alert: Workflow does not contain permissions Sep 10, 2025
@ron-tsarevsky ron-tsarevsky marked this pull request as ready for review September 10, 2025 13:42
@ron-tsarevsky ron-tsarevsky merged commit 462d154 into main Sep 10, 2025
6 of 20 checks passed
@ron-tsarevsky ron-tsarevsky deleted the workflow-permissions branch September 10, 2025 13:42
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