No more Q&A In the discussion section #17
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: Create a comment on new issues | |
on: | |
issues: | |
types: [opened] | |
jobs: | |
comment-with-action: | |
runs-on: ubuntu-latest | |
permissions: | |
issues: write | |
steps: | |
- name: "dump github context" | |
run: echo '${{ toJSON(github.event) }}' | jq | |
shell: bash | |
- name: Create comment | |
uses: peter-evans/create-or-update-comment@v3 | |
with: | |
issue-number: ${{ github.event.issue.number }} | |
body: | | |
Just kidding :laughing: will get back to you | |
reactions: 'laugh' | |
comment-with-api: | |
runs-on: ubuntu-latest | |
permissions: | |
issues: write | |
steps: | |
- name: Create comment with API | |
run: | | |
gh api -X POST \ | |
https://api.github.com/repos/${ORGANIZATION}/${REPOSITORY}/issues/${ISSUE_NUMBER}/comments \ | |
-f body=" | |
Brooo! you're creating an issue in here 😒 | |
" | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
ORGANIZATION: ${{ github.event.repository.owner.login }} | |
REPOSITORY: ${{ github.event.repository.name }} | |
ISSUE_NUMBER: ${{ github.event.issue.number }} | |