Skip to content

Instantly share code, notes, and snippets.

@derberg
Last active October 8, 2020 00:30
Show Gist options
  • Save derberg/ab362e4b37f542e7e1813e67b7cb11ee to your computer and use it in GitHub Desktop.
Save derberg/ab362e4b37f542e7e1813e67b7cb11ee to your computer and use it in GitHub Desktop.
name: 'Sentiment Analysis'
on:
issue_comment:
types:
- created
- edited
issues:
types:
- opened
- edited
pull_request:
types:
- opened
- edited
pull_request_review:
types:
- submitted
- edited
pull_request_review_comment:
types:
- created
- edited
jobs:
test:
name: Checking sentiments
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Check sentiment
uses: derberg/code-of-conduct-sentiment-analysis-github-action@v1
id: sentiments
with:
gcp_key: ${{ secrets.GCP_KEY_SENTIMENT }}
- uses: someimportantcompany/github-actions-slack-message@v1
# this step runs only if sentiment is a negative number
if: steps.sentiments.outputs.sentiment < -0.2
with:
webhook-url: ${{ secrets.SLACK_SENTIMENTS }}
text: Here ${{steps.sentiments.outputs.source}} you can find a potential negative text that requires your attention as the sentiment analysis score is ${{steps.sentiments.outputs.sentiment}}
color: orange
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment