Skip to content

Commit

Permalink
Substitute github context variables in CI email template
Browse files Browse the repository at this point in the history
  • Loading branch information
manicki committed Sep 20, 2024
1 parent 7bbde87 commit 52e4bdc
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
3 changes: 0 additions & 3 deletions .github/workflows/ci_failure_email.md

This file was deleted.

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}).
11 changes: 10 additions & 1 deletion .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 @@ -38,4 +47,4 @@ jobs:
from: ${{ github.repository }} CI
subject: CI job failed for ${{ github.repository }}
convert_markdown: true
html_body: file:///home/runner/work/Diff/Diff/.github/workflows/ci_failure_email.md
html_body: file://${{ github.workspace }}/.github/workflows/ci_failure_email.md

0 comments on commit 52e4bdc

Please sign in to comment.