From 9820f077b36431da0920c30bf171344c9f839dd5 Mon Sep 17 00:00:00 2001 From: Xingzhi Zhang <37076709+elliotzh@users.noreply.github.com> Date: Tue, 29 Aug 2023 18:56:51 +0800 Subject: [PATCH] ci: fix check_enforcer.yml (#233) # Description Please add an informative description that covers that changes made by the pull request and link all relevant issues. # All Promptflow Contribution checklist: - [ ] **The pull request does not introduce [breaking changes]** - [ ] **CHANGELOG is updated for new features, bug fixes or other significant changes.** - [ ] **I have read the [contribution guidelines](../CONTRIBUTING.md).** ## General Guidelines and Best Practices - [ ] Title of the pull request is clear and informative. - [ ] There are a small number of commits, each of which have an informative message. This means that previously merged commits do not appear in the history of the PR. For more information on cleaning up the commits in your PR, [see this page](https://github.com/Azure/azure-powershell/blob/master/documentation/development-docs/cleaning-up-commits.md). ### Testing Guidelines - [ ] Pull request includes test coverage for the included changes. --- .github/workflows/check_enforcer.yml | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/.github/workflows/check_enforcer.yml b/.github/workflows/check_enforcer.yml index 4a8361af5f0..8327503f3ae 100644 --- a/.github/workflows/check_enforcer.yml +++ b/.github/workflows/check_enforcer.yml @@ -33,13 +33,16 @@ jobs: - name: Summarize check status id: summarize_check_status run: | - status="success" - jq -c '.check_runs | .[] | select (.conclusion!="success") | .html_url' status.json | while read url; do - echo $url - status="pending" + jq -c '.check_runs[]' status.json | while read check_run; do + echo $check_run | jq '{name, html_url, conclusion}' done - echo "status=$status" >> "$GITHUB_OUTPUT" + pending_count=$(jq -c '.check_runs[].conclusion != "success" | select(.)' status.json | wc -l) + if [ $pending_count -eq 0 ]; then + echo "status=success" >> "$GITHUB_OUTPUT" + else + echo "status=pending" >> "$GITHUB_OUTPUT" + fi - uses: octokit/request-action@v2.x name: Update the check enforcer status