DEV Community

Oscar Nevárez
Oscar Nevárez

Posted on

3 2

Issue Chill Action

My Workflow

Issue Chill Action

About

This action reads a GitHub Issue and outputs its Sentiment Analysis, so you can detect whether its content is redacted in a way that make it sound positive or negative.

Example

Create a .github/workflows/issue-sentiment.yml file in your repository with the following content Make sure to replace and with your repository values.

# .github/workflows/issue-sentiment.yml
name: Issue Sentiment Analysis
on:
  issues:
    types: [opened, edited]

jobs:  
  add-comment:
    runs-on: ubuntu-latest
    permissions:
      issues: write
    steps:
      - name: Sentiment Analysis
        id: sa
        uses: oscarnevarezleal/issue-chill@master
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
        with:
          owner: <org>
          repo: <repo>
          issue: ${{ github.event.issue.number }}

      - name: Add positive comment
        if: ${{ startsWith(steps.sa.outputs.IS_50_POS, 'true') }} # 60, 70, 80 and 90 also available
        uses: peter-evans/create-or-update-comment@a35cf36e5301d70b76f316e867e7788a55a31dae
        with:
          issue-number: ${{ github.event.issue.number }}
          body: |
            This issue
Enter fullscreen mode Exit fullscreen mode

Submission Category:

Maintaner Must-Haves

Yaml File or Link to Code

Usage

# .github/workflows/issue-sentiment.yml

name: Issue Sentiment Analysis
on:
  issues:
    types: [opened, edited]

jobs:  
  add-comment:
    runs-on: ubuntu-latest
    permissions:
      issues: write
    steps:
      - name: Sentiment Analysis
        id: sa
        uses: oscarnevarezleal/issue-chill@master
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
        with:
          owner: <org>
          repo: <repo>
          issue: ${{ github.event.issue.number }}

      - name: Add positive comment
        if: ${{ startsWith(steps.sa.outputs.IS_50_POS, 'true') }} # 60, 70, 80 and 90 also available
        uses: peter-evans/create-or-update-comment@a35cf36e5301d70b76f316e867e7788a55a31dae
        with:
          issue-number: ${{ github.event.issue.number }}
          body: |
            This issue is available for anyone to work on. **Make sure to reference this issue in your pull request.** :sparkles: Thank you for your contribution! :sparkles:

      - name: Add negative reaction
        if: ${{ startsWith(steps.sa.outputs.IS_70_NEG, 'true') }} # 50, 60, 70, 80 and 90 also available
        uses: peter-evans/create-or-update-comment@a35cf36e5301d70b76f316e867e7788a55a31dae
        with:
          issue-number: ${{ github.event.issue.number }}
          body: |
            Please refer to the Code Of Conduct.
            > "This Aggression Will Not Stand, Man."
Enter fullscreen mode Exit fullscreen mode

Additional Resources / Info

Speedy emails, satisfied customers

Postmark Image

Are delayed transactional emails costing you user satisfaction? Postmark delivers your emails almost instantly, keeping your customers happy and connected.

Sign up

Top comments (0)

Sentry image

See why 4M developers consider Sentry, “not bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay