Skip to content

Latest commit

 

History

History
112 lines (90 loc) · 2.97 KB

README.md

File metadata and controls

112 lines (90 loc) · 2.97 KB

Spring Health Changes Requested Action

Features

  1. Adds a label when changes are requested on a PR (label-on-changes-requested = true)
  2. Slacks reviewer when label (changes requested) has been removed.
  3. Can optionally send a slack message to the author of the PR when a change is requested.

Configuration Options

  1. Must be run on: [pull_request_review, pull_request]
  2. Toggle on / off the label (label-on-changes-requested: boolean)
  3. Sets to true when label removed (alert-on-label-removed: boolean)
  4. Send a slack message to the PR author:
    • Required Must provide slack-webhook-url in your Repo's secrets
    • EITHER:
      • slack_channel: string can be provided to post to a general channel.
      • OR
      • github-slack-mapping: {<github_id>: <slack_id>} can be provided to post to the PR's author.
    • Can provide bot-name: string to customize who is sending the mesage (Default is "Spring Health")
    • Can provide icon_emoji to use an emoji as the bot's icon.

Sample Configuration:

OnlyLabel

name: Spring Health Changes Requested

on:
  pull_request_review:
    types: [submitted]

jobs:
  ChangesRequested:
    runs-on: ubuntu-latest

    steps:
    - uses: 'SpringCare/actions/dist/changes_requested@master'
      with:
        repo-token: ${{ secrets.GITHUB_TOKEN }}
        label-on-changes-requested: true

Send Message to Slack Channel & Label

name: Spring Health Changes Requested

on:
  pull_request_review:
    types: [submitted]

jobs:
  ChangesRequested:
    runs-on: ubuntu-latest

    steps:
    - uses: 'SpringCare/actions/dist/changes_requested@master'
      with:
        repo-token: ${{ secrets.GITHUB_TOKEN }}
        slack-webhook-url: ${{ secrets.SLACK_WEBHOOK_URL }}
        label-on-changes-requested: true
        bot-name: 'Good Bot'
        icon_emoji: ':dog:'
        slack-channel: '#dev'

Send Message to PR Author & Label

name: Spring Health Changes Requested

on:
  pull_request_review:
    types: [submitted]

jobs:
  ChangesRequested:
    runs-on: ubuntu-latest

    steps:
    - uses: 'SpringCare/actions/dist/changes_requested@master'
      with:
        repo-token: ${{ secrets.GITHUB_TOKEN }}
        slack-webhook-url: ${{ secrets.SLACK_WEBHOOK_URL }}
        label-on-changes-requested: true
        bot-name: 'Good Bot'
        icon_emoji: ':dog:'
        github-slack-mapping: '{"123":"U123ABC","456":"U456ABC"}'

Send Message to PR Reviewer when Requested Changes Label is Removed

name: Spring Health Changes Requested

on:
  pull_request:
    types: [unlabeled]

jobs:
  ChangesRequested:
    runs-on: ubuntu-latest

    steps:
    - uses: 'SpringCare/actions/dist/changes_requested@master'
      with:
        repo-token: ${{ secrets.GITHUB_TOKEN }}
        slack-webhook-url: ${{ secrets.SLACK_WEBHOOK_URL }}
        alert-on-label-removed: true
        bot-name: 'Good Bot'
        icon_emoji: ':dog:'
        github-slack-mapping: '{"123":"U123ABC","456":"U456ABC"}'