From 40d9e082fae916b36682685cd1722b8c485a209a Mon Sep 17 00:00:00 2001 From: Matthias Bernt Date: Wed, 11 Jan 2023 12:06:05 +0100 Subject: [PATCH 1/2] report deployment failure --- .github/workflows/pr.yaml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml index 498a6009e60..5e306dda73f 100644 --- a/.github/workflows/pr.yaml +++ b/.github/workflows/pr.yaml @@ -382,6 +382,24 @@ jobs: repository-list: ${{ needs.setup.outputs.repository-list }} shed-target: toolshed shed-key: ${{ secrets.TS_API_KEY }} + # report to the PR if deployment failed + - name: get PR number + uses: 8BitJonny/gh-get-current-pr@2.2.0 + id: getpr + if: ${{ failure() }} + with: + github-token: ${{secrets.GITHUB_TOKEN}} + sha: ${{ github.event.after }} + - name: Create comment + uses: peter-evans/create-or-update-comment@v2 + if: ${{ failure() }} + with: + token: ${{ secrets.PAT }} + issue-number: ${{ steps.getpr.outputs.number }} + body: | + Attention: deployment failed! + + https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }} determine-success: name: Check workflow success From 43927818ac937e30c1a6619b2bce4c6fef08e926 Mon Sep 17 00:00:00 2001 From: M Bernt Date: Sun, 15 Jan 2023 12:20:13 +0100 Subject: [PATCH 2/2] Apply suggestions from code review Co-authored-by: Nicola Soranzo --- .github/workflows/pr.yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml index 5e306dda73f..ef1a1008c65 100644 --- a/.github/workflows/pr.yaml +++ b/.github/workflows/pr.yaml @@ -383,12 +383,11 @@ jobs: shed-target: toolshed shed-key: ${{ secrets.TS_API_KEY }} # report to the PR if deployment failed - - name: get PR number + - name: Get PR object uses: 8BitJonny/gh-get-current-pr@2.2.0 id: getpr if: ${{ failure() }} with: - github-token: ${{secrets.GITHUB_TOKEN}} sha: ${{ github.event.after }} - name: Create comment uses: peter-evans/create-or-update-comment@v2