Testing - Create auto-comment.yml #1
This file contains hidden or 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
| name: Auto Comment on Issues | ||
| on: | ||
| issues: | ||
| types: [opened] | ||
| jobs: | ||
| comment: | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| issues: write | ||
| steps: | ||
| - name: Comment on new issue | ||
| uses: actions/github-script@v7 | ||
| with: | ||
| script: | | ||
| const issueNumber = context.payload.issue.number; | ||
| const username = context.payload.issue.user.login; | ||
| const comment = ` | ||
| 👋 Hey @${username} — thanks for opening an issue! | ||
| Before we dive in, make sure to check out our [contributing guide](CONTRIBUTING.md) and see if this has already been reported. | ||
| We appreciate your help! 💖 | ||
| `; | ||
| await github.rest.issues.createComment({ | ||
| owner: context.repo.owner, | ||
| repo: context.repo.repo, | ||
| issue_number: issueNumber, | ||
| body: comment | ||
| }); | ||