Skip to content

Commit

Permalink
try curl
Browse files Browse the repository at this point in the history
  • Loading branch information
ptitloup committed Sep 21, 2023
1 parent 1872b38 commit 4ad22b3
Showing 1 changed file with 24 additions and 15 deletions.
39 changes: 24 additions & 15 deletions .github/workflows/commentPR.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}

0 comments on commit 4ad22b3

Please sign in to comment.