Skip to content

Commit 369b850

Browse files
authored
Merge pull request moby#4586 from crazy-max/v0.12_backport_hack-enforce-context
[0.12 backport] use local context and disable image push if not upstream repo
2 parents 3f86f92 + 708eaf4 commit 369b850

File tree

3 files changed

+7
-1
lines changed

3 files changed

+7
-1
lines changed

.github/workflows/buildkit.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,9 @@ jobs:
8181
PUSH=push
8282
fi
8383
fi
84+
if [ "$GITHUB_REPOSITORY" != "moby/buildkit" ]; then
85+
PUSH=false
86+
fi
8487
echo "tag=${TAG}" >>${GITHUB_OUTPUT}
8588
echo "push=${PUSH}" >>${GITHUB_OUTPUT}
8689
platforms=$(docker buildx bake release --print | jq -cr '.target."release".platforms')

.github/workflows/frontend.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,9 @@ jobs:
6161
PUSH=push
6262
fi
6363
fi
64+
if [ "$GITHUB_REPOSITORY" != "moby/buildkit" ]; then
65+
PUSH=false
66+
fi
6467
echo "typ=${TYP}" >>${GITHUB_OUTPUT}
6568
echo "push=${PUSH}" >>${GITHUB_OUTPUT}
6669
echo "tag=${TAG}" >>${GITHUB_OUTPUT}

hack/util

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ currentref=""
5353
currentcontext="."
5454
cacheFromFlags=""
5555
cacheToFlags=""
56-
if [ "$GITHUB_ACTIONS" = "true" ]; then
56+
if [ "$GITHUB_ACTIONS" = "true" ] && [ "$GITHUB_REPOSITORY" = "moby/buildkit" ]; then
5757
currentref="https://github.com/$GITHUB_REPOSITORY.git#$GITHUB_REF"
5858
if [ -n "$CACHE_FROM" ]; then
5959
for cfrom in $CACHE_FROM; do

0 commit comments

Comments
 (0)