From 5e755a42b4a3cbd12d1828cdf4b98d66ac4316fc Mon Sep 17 00:00:00 2001 From: Kevin Minehart <5140827+kminehart@users.noreply.github.com> Date: Fri, 14 Nov 2025 12:25:24 +0100 Subject: [PATCH] [release-12.0.7] CI: Make notify-pr workflow optional (#113901) * 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) * 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) --- .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 650ba6a67c1..dcf26ac51ab 100644 --- a/.github/workflows/release-build.yml +++ b/.github/workflows/release-build.yml @@ -320,20 +320,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 }}