diff --git a/.github/workflows/performance-tests.yml b/.github/workflows/performance-tests.yml index 38eb62ad34..5287705930 100644 --- a/.github/workflows/performance-tests.yml +++ b/.github/workflows/performance-tests.yml @@ -65,11 +65,13 @@ jobs: - name: Post or update PR comment env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + PICRD_API_KEY: ${{ secrets.PICRD_API_KEY }} PR_NUMBER: ${{ github.event.number }} shell: bash + if: github.event.pull_request.head.repo.full_name == github.repository run: | uploadImage() { - curl --fail --retry 3 -sS -F "file=@$1" -F "visibility=unlisted" https://picrd.com/api/upload | jq -r '.image_url // empty' || true + curl --fail --retry 3 -sS -H "Authorization: Bearer $PICRD_API_KEY" -F "file=@$1" -F "visibility=unlisted" https://picrd.com/api/upload | jq -r '.raw_url // empty' || true } PREVIEW_URL=$(uploadImage .ci/atime/tests_preview_facet.png) ALL_URL=$(uploadImage .ci/atime/tests_all_facet.png) @@ -112,6 +114,4 @@ jobs: cat comment.md >> "$GITHUB_STEP_SUMMARY" - if [ "${{ github.event.pull_request.head.repo.full_name }}" = "$GITHUB_REPOSITORY" ]; then - gh pr comment "$PR_NUMBER" --edit-last --create-if-none -F comment.md - fi + gh pr comment "$PR_NUMBER" --edit-last --create-if-none -F comment.md