Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

notify about docker build failures

Markus Kahl6daeb887680c
diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml
index df3375aeabf..f9e1ab01185 100644
--- a/.github/workflows/docker.yml
+++ b/.github/workflows/docker.yml
@@ -90,7 +90,7 @@ jobs:
echo "Unsupported event"
exit 1
fi
-
+
if [ -z "$TAG_REF" ] || [ -z "$CHECKOUT_REF" ]; then
echo "No TAG_REF or CHECKOUT_REF set. Aborting"
exit 1
@@ -240,3 +240,11 @@ jobs:
- name: Inspect image
run: |
docker buildx imagetools inspect ${{ env.REGISTRY_IMAGE }}:${{ steps.meta.outputs.version }}
+ notify:
+ needs: [extract_version, build, merge]
+ if: ${{ always() && contains(needs.*.result, 'failure') }}
+ uses: ./.github/workflows/email-notification.yml
+ secrets: inherit
+ with:
+ subject: "Docker build failed"
+ body: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
diff --git a/.github/workflows/email-notification.yml b/.github/workflows/email-notification.yml
new file mode 100644
index 00000000000..9e9799ad1ff
--- /dev/null
+++ b/.github/workflows/email-notification.yml
@@ -0,0 +1,38 @@
+name: email-notification
+
+on:
+ workflow_call:
+ inputs:
+ subject:
+ type: string
+ required: true
+ body:
+ type: string
+ required: true
+ from:
+ type: string
+ default: Github CI <[email protected]>
+ to:
+ type: string
+ secrets:
+ OPS_MAIL_SMTP_TOKEN:
+ required: true
+
+jobs:
+ notify:
+ name: Notify
+ runs-on: ubuntu-latest
+ steps:
+ - name: Send mail
+ uses: dawidd6/action-send-mail@v3
+ with:
+ subject: ${{ inputs.subject }}
+ body: ${{ inputs.body }}
+ from: ${{ inputs.from }}
+ to: ${{ inputs.to }}
+ secure: false
+ server_port: 587
+ server_address: smtp.postmarkapp.com
+ username: PM-T-outbound-bw6Xf6uoKnU76g1RcuydgZ
+ password: ${{secrets.OPS_MAIL_SMTP_TOKEN }}