diff --git a/.github/workflows/greetings.yml b/.github/workflows/greetings.yml index c388e4e..a20a9aa 100644 --- a/.github/workflows/greetings.yml +++ b/.github/workflows/greetings.yml @@ -9,8 +9,17 @@ jobs: issues: write pull-requests: write steps: - - uses: actions/first-interaction@v1 - with: - repo-token: ${{ secrets.GITHUB_TOKEN }} - issue-message: "Thank you ${{ github.event.pull_request.user.login }} 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 ${{ github.event.pull_request.user.login }}. We'll will review it as soon as possible 🙌❤️" + - 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: + 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 will review it as soon as possible 🙌❤️"