diff --git a/.github/workflows/ghapi.yml b/.github/workflows/ghapi.yml new file mode 100644 index 0000000..f1b0150 --- /dev/null +++ b/.github/workflows/ghapi.yml @@ -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 }}