Skip to content

Potential fix for code scanning alert no. 1062: Workflow does not contain permissions#76

Merged
HosseinNejatiJavaremi merged 1 commit intomasterfrom
alert-autofix-1062
Aug 28, 2025
Merged

Potential fix for code scanning alert no. 1062: Workflow does not contain permissions#76
HosseinNejatiJavaremi merged 1 commit intomasterfrom
alert-autofix-1062

Conversation

@HosseinNejatiJavaremi
Copy link
Copy Markdown
Member

Potential fix for https://github.com/SyntaxArc/ArchiPy/security/code-scanning/1062

To fix the problem, we need to add an explicit permissions: block. The best practice is to define this at the job level (so it doesn't inadvertently restrict unrelated jobs) or at the workflow root if all jobs need the same. In this workflow, there is a single job, so either approach is fine, but for minimal change, we'll add permissions: just above runs-on: inside the behave-tests: job. This block should grant only the least necessary privileges, which for test jobs is usually contents: read, allowing read-only access to repository files so the workflow can check out code. No other permissions appear to be required for this workflow.

Edit .github/workflows/tests.yml and insert:

permissions:
  contents: read

above the runs-on: ubuntu-latest line inside the behave-tests: job.

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

…tain permissions

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
@HosseinNejatiJavaremi HosseinNejatiJavaremi marked this pull request as ready for review August 28, 2025 08:51
@HosseinNejatiJavaremi HosseinNejatiJavaremi merged commit 743058e into master Aug 28, 2025
7 checks passed
@HosseinNejatiJavaremi HosseinNejatiJavaremi deleted the alert-autofix-1062 branch August 28, 2025 08:53
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