Skip to content

Commit

Permalink
Create ghapi.yml for greeting on issues
Browse files Browse the repository at this point in the history
  • Loading branch information
shakibyzn authored Sep 12, 2024
1 parent 5b4ac1c commit 455f7b3
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/ghapi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Greeting on issues
on:
issues:
types:
- opened

permissions:
contents: read
issues: write
pull-requests: write

jobs:
ghapi:
runs-on: ubuntu-latest
steps:
- name: install dependencies
run: pip install ghapi

- name: see payload # this step is for debugging purposes only, so you can see the payload.
run: echo "PAYLOAD:\n${PAYLOAD}\n"
env:
PAYLOAD: ${{ toJSON(github.event) }}

- name: Make a comment
shell: python
run: |
import os
from ghapi.core import GhApi
owner,repo = os.environ['REPO'].split('/')
api = GhApi(owner=owner, repo=repo)
api.issues.create_comment(os.environ['NUMBER'], "👋 Hi there! Thank you for coming across this project! 🙏 I really appreciate your input. I’ll check your issue soon and get back to you. 😊 Thanks for your patience!")
env:
NUMBER: ${{ github.event.number }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
REPO: ${{ github.repository }}

0 comments on commit 455f7b3

Please sign in to comment.