<#7327 ci(build-ci-image): use pull_request_target...
# flyte-github
a
#7327 ci(build-ci-image): use pull_request_target so fork PRs can access DEPOT_PROJECT_ID Pull request opened by pingsutw Why Same root cause as #7320 (which fixed
flyte-binary-v2.yml
): the
Build and Publish CI Docker Image
workflow validates and uses
vars.DEPOT_PROJECT_ID
, but GitHub does not pass repository variables to workflows triggered by
pull_request
events from forks. As a result, the
Validate Depot project id
step fails on every fork PR (e.g. PR #7326 from
Sovietaced/flyte
):
Copy code
##[error]DEPOT_PROJECT_ID repo variable is not set.
What changed •
pull_request
→
pull_request_target
so
vars.*
is available. •
actions/checkout@v4
pinned to
github.event.pull_request.head.sha || github.sha
with
persist-credentials: false
so the workflow builds the PR's Dockerfile (default for
pull_request_target
would be the base ref) without leaking the base-repo
GITHUB_TOKEN
into fork-controlled code. •
event_name == 'pull_request'
checks updated to also match
pull_request_target
. Security considerations • The image push tag is namespaced to
pr-
, so fork PRs can only push to their own PR-scoped tag, not overwrite `latest`/`v2`. • The PR comment step is also bounded to the triggering PR. • The base-repo value exposed to fork code is
vars.DEPOT_PROJECT_ID
(a public Depot project id, not a credential). Auth to Depot uses OIDC. Test plan • In-repo branches still build and push. • After merge, fork PR #7326 re-runs and
Validate Depot project id
passes. • Fork PR builds publish under
pr-
tag, no overwrite of
latest
. flyteorg/flyte