Skip to content

Commit

Permalink
use REST API for github comment
Browse files Browse the repository at this point in the history
  • Loading branch information
JacobBarthelmeh committed Feb 25, 2025
1 parent 296cd16 commit f36a7eb
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions .github/workflows/sftp-benchmark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -153,14 +153,15 @@ jobs:
path: wolfssh/openssh-average-download.csv

- name: Comment on PR about performance
working-directory: ./wolfssh/
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
ARTIFACT_URL=$(gh api repos/wolfSSL/wolfssh/actions/artifacts --jq '.artifacts[] | select(.name=="upload-results") | .archive_download_url')
PR_NUMBER=$(jq --raw-output .pull_request.number "$GITHUB_EVENT_PATH")
gh pr comment $PR_NUMBER --body "Performance results are located here [benchmark artifacts]($ARTIFACT_URL)"
ARTIFACT_URL=$(gh api repos/${{ github.repository }}/actions/artifacts \
--jq '.artifacts[0].archive_download_url')
curl -X POST \
-H "Authorization: token ${{ github.token }}" \
-H "Accept: application/vnd.github.v3+json" \
"https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.pull_request.number }}/comments" \
-d "{\"body\":\"Graphs available in [workflow artifacts]($ARTIFACT_URL)\"}"
- name: Print logs if failed
working-directory: ./wolfssh/
Expand Down

0 comments on commit f36a7eb

Please sign in to comment.