Skip to content

Commit

Permalink
Merge pull request #4580 from crazy-max/hack-enforce-context
Browse files Browse the repository at this point in the history
use local context and disable image push if not upstream repo
  • Loading branch information
tonistiigi authored Jan 24, 2024
2 parents 83fd009 + 0e70765 commit 89bbb62
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
3 changes: 3 additions & 0 deletions .github/workflows/buildkit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@ jobs:
PUSH=push
fi
fi
if [ "$GITHUB_REPOSITORY" != "moby/buildkit" ]; then
PUSH=false
fi
echo "tag=${TAG}" >>${GITHUB_OUTPUT}
echo "push=${PUSH}" >>${GITHUB_OUTPUT}
platforms=$(docker buildx bake release --print | jq -cr '.target."release".platforms')
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/frontend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@ jobs:
PUSH=push
fi
fi
if [ "$GITHUB_REPOSITORY" != "moby/buildkit" ]; then
PUSH=false
fi
echo "typ=${TYP}" >>${GITHUB_OUTPUT}
echo "push=${PUSH}" >>${GITHUB_OUTPUT}
echo "tag=${TAG}" >>${GITHUB_OUTPUT}
Expand Down
2 changes: 1 addition & 1 deletion hack/util
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ currentref=""
currentcontext="."
cacheFromFlags=""
cacheToFlags=""
if [ "$GITHUB_ACTIONS" = "true" ]; then
if [ "$GITHUB_ACTIONS" = "true" ] && [ "$GITHUB_REPOSITORY" = "moby/buildkit" ]; then
currentref="https://github.com/$GITHUB_REPOSITORY.git#$GITHUB_REF"
if [ -n "$CACHE_FROM" ]; then
for cfrom in $CACHE_FROM; do
Expand Down

0 comments on commit 89bbb62

Please sign in to comment.