From 39dfc56e829392047fe9574338db1033f92ec8fe Mon Sep 17 00:00:00 2001 From: Matthias Bernt Date: Mon, 16 Oct 2023 11:40:08 +0200 Subject: [PATCH] add reporting of deployment errors --- .github/workflows/workflow_test.yml | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/.github/workflows/workflow_test.yml b/.github/workflows/workflow_test.yml index fe9956275..5e87f9cee 100644 --- a/.github/workflows/workflow_test.yml +++ b/.github/workflows/workflow_test.yml @@ -139,3 +139,25 @@ jobs: workflows: true workflow-namespace: iwc-workflows github-token: ${{ secrets.IWC_WORKFLOWS_BOT_TOKEN }} + + deploy-report: + name: Report deploy status + needs: [deploy] + if: ${{ always() && needs.deploy.result != 'success' && (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main' ) && github.repository_owner == 'galaxyproject' }} + runs-on: ubuntu-latest + steps: + # report to the PR if deployment failed + - name: Get PR object + uses: 8BitJonny/gh-get-current-pr@2.2.0 + id: getpr + with: + sha: ${{ github.event.after }} + - name: Create comment + uses: peter-evans/create-or-update-comment@v2 + with: + token: ${{ secrets.PAT }} + issue-number: ${{ steps.getpr.outputs.number }} + body: | + Attention: deployment ${{ needs.deploy.result }}! + + https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}