diff --git a/.github/workflows/ci_failure_email.md.tmpl b/.github/workflows/ci_failure_email.md.tmpl new file mode 100644 index 0000000..322186b --- /dev/null +++ b/.github/workflows/ci_failure_email.md.tmpl @@ -0,0 +1,3 @@ +CI workflow ${WORKFLOW} failed! + +The failed job can be found in [here](${SERVER_URL}/${REPOSITORY}/actions/runs/${RUN_ID}). diff --git a/.github/workflows/push.yaml b/.github/workflows/push.yaml index 9b1559b..906c9d7 100644 --- a/.github/workflows/push.yaml +++ b/.github/workflows/push.yaml @@ -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 @@ -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 here + convert_markdown: true + html_body: file://${{ github.workspace }}/.github/workflows/ci_failure_email.md