diff --git a/.github/workflows/greetings.yml b/.github/workflows/greetings.yml new file mode 100644 index 0000000..9706383 --- /dev/null +++ b/.github/workflows/greetings.yml @@ -0,0 +1,34 @@ +name: Greetings + +on: [pull_request_target, issues] + +jobs: + greeting: + runs-on: ubuntu-latest + permissions: + issues: write + pull-requests: write + steps: + - name: Greet user on every pull request + if: github.event_name == 'pull_request_target' + uses: actions/github-script@v7 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + script: | + const comment = ` + Hello ! + + Thank you for opening a pull request. We appreciate your contribution. + + Please make sure to read our contribution guidelines and let us get back to you. + + In the meantime grab a cup of :coffee: + + Thanks again! + ` + await github.rest.issues.createComment({ + issue_number: context.issue.number, + owner: context.repo.owner, + repo: context.repo.repo, + body: comment + }) \ No newline at end of file