Skip to content

isacarvid/PR-review-notification

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This GitHub action triggers on a PR review update (comment, requested changes, approve changes).

Setup

Pre-requisites

Add secrets to your repository's Github secrets. The keys are as follows:

EMAIL_USERNAME, eg. name@server.com

EMAIL_PASSWORD, eg. passwordToEmail

EMAIL_DOMAIN, eg. smtp.gmail.com

Inputs

❗ = Required

  Input Description
filePath Path to the readme. Where notification addresses are to be found. Computed by the steps in workflow.
usernameSecret The username to the Email to send notifications from. Fetched from secrets.
passwordSecret Password to email to send notification from. Fetched from secrets.
domainSecret smtp server to send email from. Eg. smtp.gmail.com
keyword Keyword to be included in a PR-readme if notification is to be enabled.

Example workflow

name: someName
on:
  pull_request_review:
    types: [edited, dismissed, submitted]
  
jobs:
  Notifier:
    name: someName
    runs-on: ubuntu-latest
    steps:
      - name: Set up Python 3.7
        uses: actions/setup-python@v2
        with:
          python-version: "3.7"
      - name: Checkout
        uses: actions/checkout@v2
      - name: Get README.md
        run: |
          git fetch --quiet
          diffFiles=$(git diff origin/master HEAD --name-only)
          diffFiles="${diffFiles//'%'/'%25'}"
          diffFiles="${diffFiles//$'\n'/'%0A'}"
          diffFiles="${diffFiles//$'\r'/'%0D'}"
          echo "::set-output name=files::$diffFiles"
        id: get-diff
      - name: run python
        uses: isacarvid/ isacarvid/PR-review-notification@v1.2
        with:
          filePath: ${{ steps.get-diff.outputs.files}}
          usernameSecret: ${{ secrets.EMAIL_USERNAME }}
          passwordSecret: ${{ secrets.EMAIL_PASSWORD }}
          domainSecret: ${{ secrets.EMAIL_DOMAIN }}
          keyword: '#notify'