Skip to content

Commit f36a7eb

Browse files
use REST API for github comment
1 parent 296cd16 commit f36a7eb

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

.github/workflows/sftp-benchmark.yml

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -153,14 +153,15 @@ jobs:
153153
path: wolfssh/openssh-average-download.csv
154154

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

0 commit comments

Comments
 (0)