diff --git a/.github/workflows/release-build.yml b/.github/workflows/release-build.yml index 435fc8b6849..22e3ada167e 100644 --- a/.github/workflows/release-build.yml +++ b/.github/workflows/release-build.yml @@ -320,12 +320,16 @@ jobs: repositories: '["grafana"]' permissions: '{"issues": "write", "pull_requests": "write", "contents": "read"}' - name: Find PR + continue-on-error: true + id: find-pr env: GITHUB_TOKEN: ${{ steps.generate_token.outputs.token }} GRAFANA_COMMIT: ${{ needs.setup.outputs.grafana-commit }} - run: echo "ISSUE_NUMBER=$(gh api "/repos/grafana/grafana/commits/${GRAFANA_COMMIT}/pulls" | jq -r '.[0].number')" >> "$GITHUB_ENV" + REPO: ${{ github.repository }} + run: echo "ISSUE_NUMBER=$(gh api "/repos/grafana/${REPO}/commits/${GRAFANA_COMMIT}/pulls" | jq -r '.[0].number')" >> "$GITHUB_ENV" - name: Find Comment uses: peter-evans/find-comment@3eae4d37986fb5a8592848f6a574fdf654e61f9e # v3 + if: ${{ steps.find-pr.outcome == 'success' }} id: fc with: issue-number: ${{ env.ISSUE_NUMBER }} @@ -334,6 +338,7 @@ jobs: token: ${{ steps.generate_token.outputs.token }} - name: Create or update comment uses: peter-evans/create-or-update-comment@e8674b075228eee787fea43ef493e45ece1004c9 # v4 + if: ${{ steps.find-pr.outcome == 'success' }} with: token: ${{ steps.generate_token.outputs.token }} comment-id: ${{ steps.fc.outputs.comment-id }}