mirror of
https://github.com/RayLabsHQ/gitea-mirror.git
synced 2026-11-16 14:45:02 -06:00
[PR #369] [MERGED] fix(ci): skip Docker Scout on fork PRs and add a Trivy scan for every PR #8280
Reference in New Issue
Block a user
📋 Pull Request Information
Original PR: https://github.com/RayLabsHQ/gitea-mirror/pull/369
Author: @arunavo4
Created: 8/24/2026
Status: ✅ Merged
Merged: 8/24/2026
Merged by: @arunavo4
Base:
main← Head:fix/ci-fork-pr-scans📝 Commits (1)
3ff7f0bfix(ci): skip Docker Scout on fork PRs and add a Trivy scan for every PR📊 Changes
2 files changed (+59 additions, -24 deletions)
View changed files
📝
.github/workflows/README.md(+10 -17)📝
.github/workflows/docker-build.yml(+49 -7)📄 Description
Context: #368. The docker check fails on every fork PR (and Dependabot PR) because GitHub never hands repository secrets to those runs. The Docker Hub login gets empty credentials and Docker Scout then dies with
could not authenticate: user githubactions not entitled to use Docker Scout. Same-repo PRs pass because the secrets are there. You can see the pattern in the run history: #367, #365, #362 green, #368, #356, #357, #359 red at the same step.This isn't a security problem, it's the secret isolation doing its job. The only way to get Scout working on forks would be
pull_request_targetwith the PR head checked out, which would build an untrusted Dockerfile with the Docker Hub token in the environment. Not doing that.What changed:
GITHUB_TOKENis read-only on fork PRs so a comment or SARIF upload wouldn't work anyway. Informational only, same as Scout'sexit-code: false.Path does not exist.docker-scan.ymlthat doesn't exist.Testing: this PR is from the main repo so it exercises the same-repo path (Scout + Trivy both run). The fork path can't be triggered from here, but the
head.repo.full_name == github.repositoryguard is the one that already skipped the login/push/comment steps correctly on #368.actionlintis clean apart from four pre-existing shellcheck infos in the tag extraction step.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.