Skip to content

Potential fix for code scanning alert no. 1: Workflow does not contain permissions#22

Draft
xcompass wants to merge 1 commit into
masterfrom
alert-autofix-1
Draft

Potential fix for code scanning alert no. 1: Workflow does not contain permissions#22
xcompass wants to merge 1 commit into
masterfrom
alert-autofix-1

Conversation

@xcompass
Copy link
Copy Markdown
Member

Potential fix for https://github.com/ubc/moodle-docker/security/code-scanning/1

Add an explicit permissions block to the workflow so GITHUB_TOKEN is least-privileged by default.
Best fix here: define it at the workflow root (applies to all jobs unless overridden), immediately after the triggers and before jobs:. For this workflow, contents: read is the minimal and sufficient starting point for checkout/build/push-to-Docker-Hub behavior shown.

File to change:

  • .github/workflows/main.yml
    Region:
  • Between workflow_dispatch: and jobs:.

No imports, methods, or external definitions are needed (YAML config 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>
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