π
Pull Request Action This action provides the following functionaliy for the Github Actions users:
- Auto comment on opening a new PR.
- Auto react to the same PR.
- Auto assign the PR to it's creator.
- Special message to first time contributors.
- All of the elements can me configured easily ;)
π
Prerequisites:
You'll need to create a "Repository Secret" of name GIPHY_TOKEN
and its value should be the API key of giphy. Here is the article on how to set up the giphy API KEY.
β¬οΈ
Usage:
Create a .github/workflows/pr-activity.yml
file in the repository of your choice, then add following code to it:
name: 'Pull Request Action π'
on:
pull_request:
types: [opened]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: ankur12-1610/pull-request-action@master
with:
GIPHY_TOKEN: ${{ secrets.GIPHY_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COMMENT_TEXT: 'thanks for submitting a pull request! We will try to review it as soon as we can :)' #enter your custom comment in the content variable
PR_REACTION: 'rocket' #enter your reaction here
GIPHY_TOPIC: 'Thanks a lot' #enter your giphy topic here
TAG_AUTHOR: true #enter true if you want to tag the author of the pull request
ASSIGN_TO_AUTHOR: true #enter true if you want to assign the pull request to the author of the pull request
FIRST_TIMERS_MESSAGE: ':tada: Thanks for your first contribution in this repo!' #your custom message for the first timers
The comment and the reaction to the PR can be customized according to the user.
π¬
COMMENT_TEXT:
The COMMENT_TEXT
variable can take any string so feel free to enter any comment in this section.
COMMENT_TEXT: 'thanks for submitting a pull request! We will try to review it as soon as we can :)' #enter your custom comment in the content variable
π
PR_REACTION:
The PR_REACTION
variable can also be customized. The available reactions are:
content | emoji |
---|---|
+1 |
|
-1 |
|
laugh |
|
confused |
|
rocket |
|
eyes |
|
heart |
|
hooray |
|
PR_REACTION: 'rocket' #enter your reaction here
π·οΈ
TAG_AUTHOR:
The TAG_AUTHOR
has either true
or false
boolean fields. Assigning true
will tag the author of the PR in the comment.
TAG_AUTHOR: true #enter true if you want to tag the author of the pull request or enter fase
π
ASSIGN_TO_AUTHOR:
The ASSIGN_TO_AUTHOR
has either true
or false
boolean fields. Assigning true
will assign the PR to the author of the PR.
ASSIGN_TO_AUTHOR: true #enter true if you want to assign the pull request to the author or enter false
π£
FIRST_TIMERS_MESSAGE:
Contributors who are first timers will get a special message. This variable can take any string so feel free to enter any message in this section.
FIRST_TIMERS_MESSAGE: ':tada: Thanks for your first contribution in this repo!' #your custom message for the first timers
If user wants to add GIF to the comment:
πͺ
GIPHY_TOKEN:
Without GIPHY_TOKEN
secret, the workflow cannot fetch gifs.
GIPHY_TOKEN: ${{ secrets.GIPHY_TOKEN }}
π
GIPHY_TOPIC:
The GIPHTY_TOPIC
variable can take any input, so whether you want a "thankyou" gif or "welcome" all of them is possible ;) so feel free to exploit it.
GIPHY_TOPIC: 'Thanks a lot' #enter your giphy topic here
π
Example:
Take a look at the Demo PRs:
-
Code:
name: 'Pull Request Action π' on: pull_request: types: [opened] jobs: test: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - uses: ankur12-1610/pull-request-action@master with: GIPHY_TOKEN: ${{ secrets.GIPHY_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} COMMENT_TEXT: 'thanks for submitting a pull request! We will try to review it as soon as we can :)' #enter your custom comment in the content variable PR_REACTION: 'rocket' #enter your reaction here GIPHY_TOPIC: 'Thanks a lot' #enter your giphy topic here TAG_AUTHOR: true #enter true if you want to tag the author of the pull request ASSIGN_TO_AUTHOR: true #enter true if you want to assign the pull request to the author of the pull request FIRST_TIMERS_MESSAGE: ':tada: Thanks for your first contribution in this repo!' #your custom message for the first timers
-
Code:
name: 'Pull Request Action π' on: pull_request: types: [opened] jobs: test: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - uses: ankur12-1610/pull-request-action@master with: GIPHY_TOKEN: ${{ secrets.GIPHY_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} COMMENT_TEXT: 'thanks for submitting a pull request! We will try to review it as soon as we can :)' #enter your custom comment in the content variable PR_REACTION: 'rocket' #enter your reaction here GIPHY_TOPIC: 'Thanks a lot' #enter your giphy topic here TAG_AUTHOR: true #enter true if you want to tag the author of the pull request ASSIGN_TO_AUTHOR: true #enter true if you want to assign the pull request to the author of the pull request
Inspired From
π
License:
The scripts and documentation in this project are released under the MIT License