diff --git a/.github/workflows/commentPR.yml b/.github/workflows/commentPR.yml index a366f33943..3f5816d834 100644 --- a/.github/workflows/commentPR.yml +++ b/.github/workflows/commentPR.yml @@ -16,20 +16,29 @@ jobs: - name: Checkout uses: actions/checkout@v3 - - name: Create issue using REST API + # - uses: actions/github-script@v6 + # with: + # script: | + # github.rest.issues.createComment({ + # issue_number: context.issue.number, + # owner: context.repo.owner, + # repo: context.repo.repo, + # body: '👋 Thanks for reporting!' + # }) + - name: Add comment to PR + env: + URL: ${{ github.event.pull_request.comments_url }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | - curl --request POST \ - --url https://api.github.com/repos/${{ github.repository }}/issues \ - --header 'authorization: Bearer ${{ secrets.GITHUB_TOKEN }}' \ - --header 'content-type: application/json' \ - --data '{ - "title": "Automated issue for commit: ${{ github.sha }}", - "body": "This issue was automatically created by the GitHub Action workflow **${{ github.workflow }}**. \n\n The commit hash was: _${{ github.sha }}_." - }' \ - --fail + curl \ + -X POST \ + $URL \ + -H "Content-Type: application/json" \ + -H "Authorization: token $GITHUB_TOKEN" \ + --data '{ "body": "blah blah" }' - - name: Comment PR - uses: thollander/actions-comment-pull-request@v2 - with: - message: 'Hello world ! :wave:' - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + # - name: Comment PR + # uses: thollander/actions-comment-pull-request@v2 + # with: + # message: 'Hello world ! :wave:' + # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}