From 316c4696bde72c3feefab44669271366eeecd920 Mon Sep 17 00:00:00 2001 From: Samuele Musiani Date: Thu, 23 May 2024 10:40:13 +0200 Subject: [PATCH] avoid dependabot to push on docker --- .github/workflows/build.yaml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 7a56a6b..3e8ad66 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -37,9 +37,15 @@ jobs: a=${{ github.ref_name }} echo "branch_name=${a//\//-}" >> $GITHUB_ENV + # PR opened by dependabot can't push. I didn't find other way + # to avoid it + + - name: Check if 'dependabot' is in branch name + run: echo "IS_NOT_DEPENDABOT=$([[ $(echo ${{ github.branch_name }}) == *dependabot* ]] && echo "false" || echo "true")" >> $GITHUB_ENV + - name: Build and push with ref name uses: docker/build-push-action@v3 - with: + with: context: . - push: true + push: ${{ env.IS_NOT_DEPENDABOT }} tags: ghcr.io/${{ github.repository }}:${{ env.branch_name }}