Last active
October 26, 2023 07:18
-
-
Save Mastersam07/0210dfb2d35d39549d2e240c08b255bd to your computer and use it in GitHub Desktop.
Automated Responses Github Actions
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: Automated Responses | |
on: | |
issues: | |
types: [opened] | |
pull_request: | |
types: [opened] | |
jobs: | |
respond: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Comment on new issue | |
if: github.event_name == 'issues' | |
uses: actions/github-script@v6 | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
script: | | |
github.rest.issues.createComment({ | |
issue_number: context.issue.number, | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
body: 'Thanks for opening this issue! A maintainer will review it soon.', | |
}) | |
- name: Comment on new pull request | |
if: github.event_name == 'pull_request' | |
uses: actions/github-script@v6 | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
script: | | |
github.rest.pulls.createReview({ | |
pull_number: context.pull_request.number, | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
body: 'Thanks for opening this pull request! A maintainer will review it soon.', | |
event: 'COMMENT', | |
}) |
Thanks for these boss @Mastersam07!
Is there an overall tutorial on this actually? It still seems confusing
Nice one Master Sam. 😉
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Awesome! Thanks for these boss, gonna add all 4 files and test them out! 🙌