From b74d0a8432169a880ba7ba50fe5c2a8c925e7d0c Mon Sep 17 00:00:00 2001 From: Kevin Minehart <5140827+kminehart@users.noreply.github.com> Date: Fri, 14 Nov 2025 12:47:18 +0100 Subject: [PATCH] [release-12.1.4] CI: Make notify-pr workflow optional (#113903) * CI: Make notify-pr workflow optional (#113896) * CI: Make notify-pr workflow optional * also set repo to the current repo * fix find-pr (cherry picked from commit d92cb9f7a6dde75c75cf8d49af52747ba5b160c7) (cherry picked from commit 3b345a99bcd75231411c135a3f63aa61c8d1ba2c) * CI: Continue notify even on error (cherry picked from commit 2e33b077f1cde2334848f83da7cdc2c19d096e7a) * CI: Fix release-build bug; github.repository includes org (#113909) * CI: Fix release-build bug; github.repository includes org * set pipefail * fix notify in release-build; this step should fail if it actually fails (cherry picked from commit 9376d569cc5505a7be36627a3019de293a221a42) * CI: release-build.yml missing pipe (#113915) (cherry picked from commit 92ef1c4942f715b26469b7bd933f6dbc3bc70b49) --- .github/workflows/release-build.yml | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release-build.yml b/.github/workflows/release-build.yml index ff65d90cf5b..e2f801c33da 100644 --- a/.github/workflows/release-build.yml +++ b/.github/workflows/release-build.yml @@ -311,20 +311,29 @@ 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: | + set -eo pipefail + gh api "/repos/${REPO}/commits/${GRAFANA_COMMIT}/pulls" | jq -r '.[0].number' | tee issue_number.txt + echo "ISSUE_NUMBER=$(cat issue_number.txt)" >> "$GITHUB_ENV" - name: Find Comment uses: peter-evans/find-comment@3eae4d37986fb5a8592848f6a574fdf654e61f9e # v3 + if: ${{ steps.find-pr.outcome == 'success' }} id: fc + continue-on-error: true with: issue-number: ${{ env.ISSUE_NUMBER }} comment-author: 'grafana-delivery-bot[bot]' body-includes: GitHub Actions Build token: ${{ steps.generate_token.outputs.token }} - name: Create or update comment - uses: peter-evans/create-or-update-comment@71345be0265236311c031f5c7866368bd1eff043 # v4 + uses: peter-evans/create-or-update-comment@e8674b075228eee787fea43ef493e45ece1004c9 # v4 + if: ${{ steps.find-pr.outcome == 'success' }} # Run even if comment wasn't found with: token: ${{ steps.generate_token.outputs.token }} comment-id: ${{ steps.fc.outputs.comment-id }}