Skip to content
This repository has been archived by the owner on May 20, 2020. It is now read-only.
/ email Public archive

GitHub Action to send emails for Check Suites

License

Notifications You must be signed in to change notification settings

cirrus-actions/email

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Deprecated

Now it's possible to use GitHub Action's own emails by adding the following workflow to your .github/worflow/email.yml

on:
  check_suite:
    type: ['completed']

name: Email about Cirrus CI failures
jobs:
  continue:
    name: After Cirrus CI
    if: github.event.check_suite.app.name == 'Cirrus CI' && github.event.check_suite.conclusion != 'success'
    runs-on: ubuntu-latest
    steps:
      - uses: octokit/[email protected]
        id: get_failed_check_run
        with:
          route: GET /repos/${{ github.repository }}/check-suites/${{ github.event.check_suite.id }}/check-runs?status=completed
          mediaType: '{"previews": ["antiope"]}'
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
      - run: |
          echo "Cirrus CI ${{ github.event.check_suite.conclusion }} on ${{ github.event.check_suite.head_branch }} branch!"
          echo "SHA ${{ github.event.check_suite.head_sha }}"
          echo $MESSAGE
          echo "##[error]See $CHECK_RUN_URL for details" && false
        env:
          CHECK_RUN_URL: ${{ fromJson(steps.get_failed_check_run.outputs.data).check_runs[0].html_url }}

Send Emails with GitHub Actions

Build Status

This is a simple GitHub action that allows to send emails when a GitHub Check Suite completes. This requires a few environment variables:

  • APP_NAME - Name of an application for which to send emails for.
  • MAIL_FROM - email address to send emails from.
  • MAIL_HOST - SMTP host to send emails to.
  • MAIL_USERNAME and MAIL_PASSWORD - username and password to authorize with the SMTP server.
  • GITHUB_TOKEN - is standard environment variable for GitHub actions.
  • optional IGNORED_CONCLUSIONS to secify conclusions to report. By default only success and neutral checks are ignored.

Now your action can look liker this in your .github/main.workflow workflow file:

action "Cirrus CI Email" {
  uses = "docker://cirrusactions/email:latest"
  env = {
    APP_NAME = "Cirrus CI"
  }
  secrets = ["GITHUB_TOKEN", "MAIL_FROM", "MAIL_HOST", "MAIL_USERNAME", "MAIL_PASSWORD"]
}

About

GitHub Action to send emails for Check Suites

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published