diff --git a/.github/actions/loadtest/action.yml b/.github/actions/loadtest/action.yml index 86dcf49..3f71ae9 100644 --- a/.github/actions/loadtest/action.yml +++ b/.github/actions/loadtest/action.yml @@ -208,6 +208,7 @@ runs: - name: Post PR comment if: inputs.post-comment == 'true' && inputs.pr-number != '' + continue-on-error: true uses: actions/github-script@v7 with: github-token: ${{ inputs.github-token }} @@ -234,12 +235,21 @@ runs: `**Artifacts:** [Download](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }})`, ].join('\n'); - await github.rest.issues.createComment({ - owner: context.repo.owner, - repo: context.repo.repo, - issue_number: ${{ inputs.pr-number }}, - body: body - }); + try { + await github.rest.issues.createComment({ + owner: context.repo.owner, + repo: context.repo.repo, + issue_number: ${{ inputs.pr-number }}, + body: body + }); + console.log('Comment posted successfully'); + } catch (error) { + if (error.status === 403) { + console.log('Could not post comment (fork PR with restricted permissions). Use /loadtest command to run with comment posting.'); + } else { + throw error; + } + } - name: Upload results uses: actions/upload-artifact@v4 diff --git a/.github/workflows/pull_request.yaml b/.github/workflows/pull_request.yaml index 2160c48..1ed8939 100644 --- a/.github/workflows/pull_request.yaml +++ b/.github/workflows/pull_request.yaml @@ -36,6 +36,7 @@ jobs: permissions: contents: read pull-requests: write + issues: write runs-on: ubuntu-latest name: Build