Skip to content

Commit

Permalink
avoid dependabot to push on docker
Browse files Browse the repository at this point in the history
  • Loading branch information
samuelemusiani committed May 23, 2024
1 parent 5b3fd26 commit 316c469
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}

0 comments on commit 316c469

Please sign in to comment.