From 408962dcead8301ae3885a7769264f117ea83fe0 Mon Sep 17 00:00:00 2001 From: blam Date: Thu, 28 Jan 2021 01:17:52 +0100 Subject: [PATCH] chore: last github workflow plz --- .github/workflows/tugboat.yml | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/.github/workflows/tugboat.yml b/.github/workflows/tugboat.yml index cce4df01de..3d6980c81e 100644 --- a/.github/workflows/tugboat.yml +++ b/.github/workflows/tugboat.yml @@ -80,3 +80,32 @@ jobs: - name: echo tugboat preview url run: | curl ${{steps.get-status-env.outputs.result}} + # Update the commit status with a fail or success. + - name: set status + if: ${{ success() }} + uses: actions/github-script@v3 + with: + github-token: ${{secrets.GH_SERVICE_ACCOUNT_TOKEN}} + script: | + return github.repos.createCommitStatus({ + owner: context.repo.owner, + repo: context.repo.repo, + sha: context.sha, + state: "success", + context: 'Backstage Tugboat E2E Tests', + target_url: "https://github.com/${{github.repository}}/actions/runs/${{github.run_id}}" + }); + - name: set status + if: ${{ failure() }} || ${{ cancelled() }} + uses: actions/github-script@v3 + with: + github-token: ${{secrets.GH_SERVICE_ACCOUNT_TOKEN}} + script: | + return github.repos.createCommitStatus({ + owner: context.repo.owner, + repo: context.repo.repo, + sha: context.sha, + state: "error", + context: 'Backstage Tugboat E2E Tests', + target_url: "https://github.com/${{github.repository}}/actions/runs/${{github.run_id}}" + });