Skip to content

- Validate GitHub Actions workflows and set minimum required permissions#46

Open
Copilot wants to merge 1 commit intomainfrom
copilot/validate-github-actions-workflows
Open

- Validate GitHub Actions workflows and set minimum required permissions#46
Copilot wants to merge 1 commit intomainfrom
copilot/validate-github-actions-workflows

Conversation

Copy link
Copy Markdown

Copilot AI commented Mar 25, 2026

Summary

Audited all GitHub Actions workflows and applied security best practices by restricting permissions to the required minimum.

Changes

check-dockerfile.yml

  • Added permissions: contents: read — the only permission needed for actions/checkout and docker build.

publish.yml

  • Added permissions: contents: read + packages: write — minimum required for checkout and pushing images to GHCR.
  • Replaced secrets.SECRET_TOKEN (a long-lived Personal Access Token) with secrets.GITHUB_TOKEN (a short-lived, automatically provisioned token). This eliminates the need to manage a separate secret and follows the principle of least privilege.

Security Summary

No vulnerabilities introduced. All changes reduce the attack surface by:

  1. Explicitly scoping workflow permissions instead of relying on the default (which can be read-write depending on repository settings).
  2. Using the ephemeral GITHUB_TOKEN instead of a stored PAT for GHCR authentication.

@mtracz
Copy link
Copy Markdown
Member

mtracz commented Mar 25, 2026

After this PR SECRET_TOKEN repo secret can be removed.

@mtracz mtracz marked this pull request as ready for review March 25, 2026 19:32
@mtracz mtracz requested a review from a team March 25, 2026 19:32
@mtracz mtracz requested a review from a team March 26, 2026 11:13
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.

3 participants