diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 88c6b706ab4f..5ecb33386d91 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -7,13 +7,11 @@ on: push: branches: - 'master' + - 'v[0-9]+.[0-9]+' tags: - 'v*' - 'dockerfile/*' pull_request: - branches: - - 'master' - - 'v*' env: REPO_SLUG_ORIGIN: "moby/buildkit:v0.10.0-rc1" @@ -243,7 +241,9 @@ jobs: PUSH=push elif [[ $GITHUB_REF == refs/heads/* ]]; then TAG=$(echo ${GITHUB_REF#refs/heads/} | sed -r 's#/+#-#g') - PUSH=push + if [ $GITHUB_REF = "refs/heads/${{ github.event.repository.default_branch }}" ]; then + PUSH=push + fi fi echo ::set-output name=tag::${TAG} echo ::set-output name=push::${PUSH} @@ -358,7 +358,7 @@ jobs: TYP=tag TAG=${GITHUB_REF#refs/tags/} PUSH=push - elif [[ $GITHUB_REF == refs/heads/* ]]; then + elif [ $GITHUB_REF = "refs/heads/${{ github.event.repository.default_branch }}" ]; then PUSH=push fi echo ::set-output name=typ::${TYP} diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml index e13f91f26c92..e1328e647e20 100644 --- a/.github/workflows/validate.yml +++ b/.github/workflows/validate.yml @@ -5,13 +5,11 @@ on: push: branches: - 'master' + - 'v[0-9]+.[0-9]+' tags: - 'v*' - 'dockerfile/*' pull_request: - branches: - - 'master' - - 'v*' env: REPO_SLUG_ORIGIN: "moby/buildkit:latest"