Skip to content

Commit

Permalink
bot update
Browse files Browse the repository at this point in the history
  • Loading branch information
MUDITJAINN committed Oct 9, 2024
1 parent 6b8774e commit 2ba80dc
Showing 1 changed file with 19 additions and 13 deletions.
32 changes: 19 additions & 13 deletions .github/workflows/issue_comment.yml
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 🙌❤️"

0 comments on commit 2ba80dc

Please sign in to comment.