Skip to content

Commit

Permalink
Use markdown to define "body" content of CI failure emails
Browse files Browse the repository at this point in the history
  • Loading branch information
manicki committed Sep 20, 2024
1 parent dc3b2b9 commit de22671
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/ci_failure_email.md.tmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
CI workflow ${WORKFLOW} failed!

The failed job can be found in [here](${SERVER_URL}/${REPOSITORY}/actions/runs/${RUN_ID}).
16 changes: 12 additions & 4 deletions .github/workflows/push.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,15 @@ jobs:
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php_version }}
- uses: nowactions/envsubst@v1
with:
input: ${{ github.workspace }}/.github/workflows/ci_failure_email.md.tmpl
output: ${{ github.workspace }}/.github/workflows/ci_failure_email.md
env:
WORKFLOW: ${{ github.workflow }}
SERVER_URL: ${{ github.server_url }}
REPOSITORY: ${{ github.repository }}
RUN_ID: ${{ github.run_id }}
- name: Validate composer.json and composer.lock
run: composer validate --strict
- name: Cache Composer packages
Expand All @@ -34,9 +43,8 @@ jobs:
server_port: 465
username: ${{secrets.CI_MAIL_USERNAME}}
password: ${{secrets.CI_MAIL_PASSWORD}}
to: wikidata-ci-status@wikimedia.de
to: leszek.manicki@wikimedia.de
from: ${{ github.repository }} CI
subject: CI job failed for ${{ github.repository }}
html_body: |
CI workflow ${{ github.workflow }} failed!
The failed job can be found in <a href="${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}">here</a>
convert_markdown: true
html_body: file://${{ github.workspace }}/.github/workflows/ci_failure_email.md

0 comments on commit de22671

Please sign in to comment.