-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6b8774e
commit 2ba80dc
Showing
1 changed file
with
19 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,25 @@ | ||
name: Auto-comment on new issues and pull requests | ||
on: | ||
issues: | ||
types: [opened] | ||
pull_request: | ||
types: [opened] | ||
|
||
on: [pull_request_target, issues] | ||
|
||
jobs: | ||
add-comment: | ||
greeting: | ||
runs-on: ubuntu-latest | ||
|
||
permissions: | ||
issues: write | ||
pull-requests: write | ||
steps: | ||
- name: Add comment for new issue or pull request | ||
uses: actions-ecosystem/action-create-comment@v1 | ||
- name: Set Condition | ||
id: condition | ||
run: | | ||
if [[ "${{ github.event_name }}" == 'issues' ]]; then | ||
echo "username=${{ github.event.issue.user.login }}" >> $GITHUB_ENV | ||
else | ||
echo "username=${{ github.event.pull_request.user.login }}" >> $GITHUB_ENV | ||
fi | ||
- name: Greet User | ||
uses: actions/first-interaction@v1 | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
issue-number: ${{ github.event.issue.number || github.event.pull_request.number }} | ||
body: | | ||
${{ github.event_name == 'issues' && 'Thank you @' || '' }}${{ github.event.issue.user.login || github.event.pull_request.user.login }}${{ github.event_name == 'issues' && ' for bringing up this issue to help enhance our project even further! We\'ll review it soon. 🙌❤️' || ' for opening a pull request. We\'ll review it as soon as possible 🙌❤️' }} | ||
repo-token: ${{ secrets.GITHUB_TOKEN }} | ||
issue-message: "Thank you @${{ env.username }} for bringing up this issue to help enhance our project even further! We'll review it soon. 🙌❤️" | ||
pr-message: "Thank you for opening a pull request @${{ env.username }}. We'll review it as soon as possible 🙌❤️" |