ci: fix notification tasks
All checks were successful
lint, build and push / lint (push) Successful in 6s
lint, build and push / build (push) Successful in 19s

This commit is contained in:
Michael Grote 2024-09-27 13:00:57 +02:00
parent 007cf77920
commit 992de69c5d

View file

@ -14,7 +14,7 @@ jobs:
- name: Checkout code - name: Checkout code
uses: actions/checkout@v4 uses: actions/checkout@v4
- name: Run Gitleaks - name: Run Gitleaks
uses: docker://zricethezav/gitleaks:v8.18.4 uses: docker://zricethezav/gitleaks:v8.19.3
with: with:
args: detect --no-git --verbose --source ${{ github.workspace }} args: detect --no-git --verbose --source ${{ github.workspace }}
- name: Run hadolint - name: Run hadolint
@ -25,17 +25,20 @@ jobs:
# uses: sudo-bot/action-shellcheck@latest # uses: sudo-bot/action-shellcheck@latest
# with: # with:
# cli-args: "shell.sh" # cli-args: "shell.sh"
- name: Send notification on error - name: Send notification
uses: dawidd6/action-send-mail@v3 uses: dawidd6/action-send-mail@v3
if: always() if: failure()
with: with:
connection_url: smtp://docker10.mgrote.net:1025 connection_url: smtp://docker10.mgrote.net:1025
secure: false secure: false
ignore_cert: true ignore_cert: true
to: michael.grote@posteo.de to: michael.grote@posteo.de
from: Gitea Actions <gitea@mgrote.net> from: Gitea Actions <gitea@mgrote.net>
subject: "CI Error in ${{ env.GITHUB_REPOSITORY }}" subject: "CI ${{ job.status }} in ${{ github.repository }}"
body: "Job of ${{ env.github.repository }} failed!" body: |
Repo: ${{ github.repository }}
Job: ${{ github.action }}
Status: ${{ job.status }}
build: build:
needs: [gitleaks, hadolint] # shellcheck needs: [gitleaks, hadolint] # shellcheck
@ -57,20 +60,23 @@ jobs:
run: echo "REPO_BRANCH=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_OUTPUT run: echo "REPO_BRANCH=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_OUTPUT
id: extract_branch id: extract_branch
- name: Build and push Docker image - name: Build and push Docker image
uses: https://github.com/docker/build-push-action@v5 uses: https://github.com/docker/build-push-action@v6
with: with:
context: . context: .
file: ./Dockerfile file: ./Dockerfile
push: true push: true
tags: "registry.mgrote.net/${{ steps.meta.outputs.REPO_NAME }}:latest,registry.mgrote.net/${{ steps.meta.outputs.REPO_NAME }}:${{ steps.extract_branch.outputs.REPO_BRANCH }}" tags: "registry.mgrote.net/${{ steps.meta.outputs.REPO_NAME }}:latest,registry.mgrote.net/${{ steps.meta.outputs.REPO_NAME }}:${{ steps.extract_branch.outputs.REPO_BRANCH }}"
- name: Send notification on error - name: Send notification
uses: dawidd6/action-send-mail@v3 uses: dawidd6/action-send-mail@v3
if: always() if: failure()
with: with:
connection_url: smtp://docker10.mgrote.net:1025 connection_url: smtp://docker10.mgrote.net:1025
secure: false secure: false
ignore_cert: true ignore_cert: true
to: michael.grote@posteo.de to: michael.grote@posteo.de
from: Gitea Actions <gitea@mgrote.net> from: Gitea Actions <gitea@mgrote.net>
subject: "CI Error in ${{ env.GITHUB_REPOSITORY }}" subject: "CI ${{ job.status }} in ${{ github.repository }}"
body: Job of ${{ env.github.repository }} failed! body: |
Repo: ${{ github.repository }}
Job: ${{ github.action }}
Status: ${{ job.status }}