Skip to content

Commit 3a0d56b

Browse files
raeperdcoderabbitai[bot]raeperd.park
authored
ci: skip image publishing for dependabot pushes (#66)
* Skip image publishing for Dependabot pushes * Update .github/workflows/build.yml Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * Fix image branch tag in CI --------- Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Co-authored-by: raeperd.park <raeperd@Karrot-Raeperdpark-C6X3VL249H.local>
1 parent a69b13f commit 3a0d56b

1 file changed

Lines changed: 7 additions & 5 deletions

File tree

.github/workflows/build.yml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,16 @@ jobs:
2828
path: build/libs/*.jar
2929

3030
- uses: docker/login-action@v4
31-
if: github.event_name == 'push'
31+
if: github.event_name == 'push' && github.actor != 'dependabot[bot]'
3232
with:
3333
registry: ghcr.io/raeperd
3434
username: ${{ github.actor }}
3535
password: ${{ secrets.GITHUB_TOKEN }}
3636
- name: Get branch name
37-
if: github.event_name == 'push'
38-
run: echo "BRANCH_NAME=$(echo ${GITHUB_REF#refs/heads/} | tr /# -)" >> $GITHUB_ENV
37+
if: github.event_name == 'push' && github.actor != 'dependabot[bot]'
38+
run: |
39+
BRANCH_NAME=$(printf '%s' "$GITHUB_REF_NAME" | tr '/#' '-')
40+
echo "BRANCH_NAME=$BRANCH_NAME" >> "$GITHUB_ENV"
3941
- name: Build container image
40-
if: github.event_name == 'push'
41-
run: ./gradlew jib -Djib.to.tags=${{ env.BRANCH_NAME }}
42+
if: github.event_name == 'push' && github.actor != 'dependabot[bot]'
43+
run: ./gradlew jib -Djib.to.tags="$BRANCH_NAME"

0 commit comments

Comments
 (0)