From 0dcff078bc9fd7eefa6deb48ce5fbc28b36e78f5 Mon Sep 17 00:00:00 2001 From: clearloop <26088946+clearloop@users.noreply.github.com> Date: Tue, 15 Aug 2023 21:25:43 +0400 Subject: [PATCH] ci(label): show info of check runs with mutiple commits for a PR --- .github/workflows/label.yml | 33 +++++++++++++++++++++------------ 1 file changed, 21 insertions(+), 12 deletions(-) diff --git a/.github/workflows/label.yml b/.github/workflows/label.yml index 3f29bb7770a..62521bca12c 100644 --- a/.github/workflows/label.yml +++ b/.github/workflows/label.yml @@ -10,19 +10,28 @@ concurrency: cancel-in-progress: true jobs: - check: + build: + # uses: ./.github/workflows/build.yml + # # TODO: dispatch this workflow with github action API + # # for more conditions. for example, if the there is + # # already a build check exist. (issue-2888) + # if: github.event.label.name == 'A0-pleasereview' + # with: + # macos: ${{ github.event.label.name == 'E2-forcemacos' }} runs-on: ubuntu-latest steps: - - name: Cancel Previous Runs - uses: styfle/cancel-workflow-action@0.11.0 + - uses: actions/github-script@v6 with: - access_token: ${{ github.token }} + github-token: "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" + script: | + const { + data: { + check_runs + } + } = await github.rest.checks.listForRef({ + owner: "gear-tech", + repo: "gear", + ref: "cl/issue-2888" + }); - build: - uses: ./.github/workflows/build.yml - # TODO: dispatch this workflow with github action API - # for more conditions. for example, if the there is - # already a build check exist. (issue-2888) - if: github.event.label.name == 'A0-pleasereview' - with: - macos: ${{ github.event.label.name == 'E2-forcemacos' }} + console.log(check_runs);