Skip to content

GitHub Action to send a message and add a label on issues and pull request

License

Notifications You must be signed in to change notification settings

Manoj-Paramsetti/greets-action

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

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Greets Action

What is Greets Action?

Greets Action is an automated action to send messages and add labels to events

How it works?

The Greets Action can greet when someone opens or closed an issue or pull request.
you can also manage any events using on:

How to use?

Create an action file in .github/workflows/name.yml. Here the word name can be anything.

name: Greets Action

on:
  issues:
    types: [closed]
  pull_request:
    types: [closed]

jobs:
  greeting:
    runs-on: ubuntu-latest
    steps:
      - uses: Manoj-Paramsetti/greets-action@main
        if: ${{ github.event.pull_request.merged == true }}
        with:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          # here issue_message is not given since the condition checks for the merge is true. it will
          # does not pass the checks in issue
          PR_message: 'add a message over here for the pull request'
           
      - uses: Manoj-Paramsetti/greets-action@main
        if: ${{ github.event.pull_request.merged == false}}
        with:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          issue_message: 'add message over here for issue'
          pr_message: 'add message over here for pull request'
          # labels is not a required key. you can use it when you want to add labels. it supports
          # upto 4 labels
          label_1: 'label 1'
          label_2: 'label 2'
          label_3: 'label 3'
          label_4: 'label 4' 
          

You can also pass labels in list type but you can't send list type directly. Use the list concept surrounded with quotes and inside that list should be passed. You can also add labels more than 4

name: Greets Action

on:
  issues:
    types: [closed]
  pull_request:
    types: [closed]

jobs:
  greeting:
    runs-on: ubuntu-latest
    steps:
      - uses: Manoj-Paramsetti/greets-action@main
        if: ${{ github.event.pull_request.merged == true }}
        with:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          # here issue_message is not given since the condition checks for the merge is true. it will
          # does not pass the checks in issue
          PR_message: 'add a message over here for the pull request'
           
      - uses: Manoj-Paramsetti/greets-action@main
        if: ${{ github.event.pull_request.merged == false}}
        with:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          issue_message: 'add message over here for issue'
          pr_message: 'add message over here for pull request'
          # labels is not a required key. you can use it when you want to add labels. it supports
          # more than 4 labels
          labels: '["label_1", "label_2", "label_3"]'