From 41c3536575bcfdd26168b892444b6e462be84219 Mon Sep 17 00:00:00 2001 From: Adam Stus Date: Mon, 1 Jul 2024 12:22:36 +0200 Subject: [PATCH] Updated workflow --- .github/workflows/test_integration.yaml | 33 +++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/.github/workflows/test_integration.yaml b/.github/workflows/test_integration.yaml index 8c67bf0..ec8eafe 100644 --- a/.github/workflows/test_integration.yaml +++ b/.github/workflows/test_integration.yaml @@ -44,3 +44,36 @@ jobs: env: TEST_SECRET: ${{ secrets.TEST_SECRET }} run: if [[ -z $TEST_SECRET ]]; then exit 1; else echo "OK"; fi + # Update check run called "integration-fork" + - uses: actions/github-script@v6 + id: update-check-run + if: ${{ always() }} + env: + number: ${{ github.event.client_payload.pull_request.number }} + job: ${{ github.job }} + # Conveniently, job.status maps to https://developer.github.com/v3/checks/runs/#update-a-check-run + conclusion: ${{ job.status }} + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + script: | + const { data: pull } = await github.rest.pulls.get({ + ...context.repo, + pull_number: process.env.number + }); + const ref = pull.head.sha; + + const { data: checks } = await github.rest.checks.listForRef({ + ...context.repo, + ref + }); + + const check = checks.check_runs.filter(c => c.name === process.env.job); + + const { data: result } = await github.rest.checks.update({ + ...context.repo, + check_run_id: check[0].id, + status: 'completed', + conclusion: process.env.conclusion + }); + + return result; \ No newline at end of file