[release-12.3.1] CI: Make notify-pr workflow optional (#113899)
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 d92cb9f7a6)
Co-authored-by: Kevin Minehart <5140827+kminehart@users.noreply.github.com>
This commit is contained in:
co-authored by
Kevin Minehart
parent
4506dfb056
commit
23a14ecde6
@@ -320,12 +320,16 @@ jobs:
|
|||||||
repositories: '["grafana"]'
|
repositories: '["grafana"]'
|
||||||
permissions: '{"issues": "write", "pull_requests": "write", "contents": "read"}'
|
permissions: '{"issues": "write", "pull_requests": "write", "contents": "read"}'
|
||||||
- name: Find PR
|
- name: Find PR
|
||||||
|
continue-on-error: true
|
||||||
|
id: find-pr
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ steps.generate_token.outputs.token }}
|
GITHUB_TOKEN: ${{ steps.generate_token.outputs.token }}
|
||||||
GRAFANA_COMMIT: ${{ needs.setup.outputs.grafana-commit }}
|
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
|
- name: Find Comment
|
||||||
uses: peter-evans/find-comment@3eae4d37986fb5a8592848f6a574fdf654e61f9e # v3
|
uses: peter-evans/find-comment@3eae4d37986fb5a8592848f6a574fdf654e61f9e # v3
|
||||||
|
if: ${{ steps.find-pr.outcome == 'success' }}
|
||||||
id: fc
|
id: fc
|
||||||
with:
|
with:
|
||||||
issue-number: ${{ env.ISSUE_NUMBER }}
|
issue-number: ${{ env.ISSUE_NUMBER }}
|
||||||
@@ -334,6 +338,7 @@ jobs:
|
|||||||
token: ${{ steps.generate_token.outputs.token }}
|
token: ${{ steps.generate_token.outputs.token }}
|
||||||
- name: Create or update comment
|
- name: Create or update comment
|
||||||
uses: peter-evans/create-or-update-comment@e8674b075228eee787fea43ef493e45ece1004c9 # v4
|
uses: peter-evans/create-or-update-comment@e8674b075228eee787fea43ef493e45ece1004c9 # v4
|
||||||
|
if: ${{ steps.find-pr.outcome == 'success' }}
|
||||||
with:
|
with:
|
||||||
token: ${{ steps.generate_token.outputs.token }}
|
token: ${{ steps.generate_token.outputs.token }}
|
||||||
comment-id: ${{ steps.fc.outputs.comment-id }}
|
comment-id: ${{ steps.fc.outputs.comment-id }}
|
||||||
|
|||||||
Reference in New Issue
Block a user