From b16c2fe576a3d858ce86187615413848673f2784 Mon Sep 17 00:00:00 2001 From: George Higashiyama Date: Wed, 29 May 2024 13:19:12 -0700 Subject: [PATCH] Easier testing --- .github/workflows/pull_request.yml | 37 +++++++++--------------------- 1 file changed, 11 insertions(+), 26 deletions(-) diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index 2da5221d4..524cd32fb 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -11,29 +11,14 @@ jobs: contents: write # Permission to write a repository_dispatch requests steps: - name: Create Check - id: checkrun - env: - GH_TOKEN: ${{ github.token }} # Expose the token for GH CLI - run: | - CHECKID=$(gh api -X POST -H "Accept: application/vnd.github+json" \ - -H "X-GitHub-Api-Version: 2022-11-28" \ - -f name='Super Check' \ - -f head_sha='${{ github.event.pull_request.head.sha }}' \ - -f status='queued' \ - -f 'output[title]=My Check Run Title' \ - -f 'output[summary]=A *fancy* summary' \ - -f 'output[text]=More detailed Markdown **text**' \ - --jq '.id' \ - /repos/${{ github.repository }}/check-runs) - echo "checkId=$CHECKID" >> $GITHUB_OUTPUT - - - name: Repository Dispatch - env: - GH_TOKEN: ${{ github.token }} - run: | - gh api -X POST -H "Accept: application/vnd.github+json" \ - -H "X-GitHub-Api-Version: 2022-11-28" \ - -f 'event_type=my-check' \ - -f 'client_payload[checkRunId]=${{ steps.checkrun.outputs.checkId }}' \ - -f 'client_payload[sha]=${{ github.sha }}' \ - /repos/${{ github.repository }}/dispatches \ No newline at end of file + run: sleep 10 + success: + name: Success gate + if: always() + needs: + - start-check + runs-on: ubuntu-latest + steps: + - run: jq --exit-status 'all(.result == "success")' <<< '${{ toJson(needs) }}' + - name: Done + run: exit 0 \ No newline at end of file