fix issue in features section #364
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
name: Greetings | |
on: | |
issues: | |
types: [opened] # Trigger only when a new issue is opened | |
pull_request_target: | |
types: [opened] # Trigger only when a new pull request is opened | |
jobs: | |
greeting: | |
runs-on: ubuntu-latest | |
permissions: | |
issues: write | |
pull-requests: write | |
steps: | |
- uses: actions/github-script@v6 | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
script: | | |
const { eventName, payload, repo } = context; | |
if (eventName === 'issues') { | |
if (payload.action === 'opened') { // Ensure it's only for newly opened issues | |
await github.rest.issues.createComment({ | |
issue_number: payload.issue.number, | |
owner: repo.owner, | |
repo: repo.repo, | |
body: 'Thank you for raising an issue! We will review it shortly. Stay tuned!' | |
}); | |
} | |
} else if (eventName === 'pull_request_target') { | |
if (payload.action === 'opened') { // Ensure it's only for newly opened pull requests | |
await github.rest.issues.createComment({ | |
issue_number: payload.pull_request.number, | |
owner: repo.owner, | |
repo: repo.repo, | |
body: '🎉 Thank you for your contribution! We appreciate your support in making this project better.' | |
}); | |
} | |
} |