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