Skip to content

Commit

Permalink
ci: fix check_enforcer.yml (microsoft#221)
Browse files Browse the repository at this point in the history
# Description

fix check_enforcer head_sha.

# All Promptflow Contribution checklist:
- [x] **The pull request does not introduce [breaking changes]**
- [x] **CHANGELOG is updated for new features, bug fixes or other
significant changes.**
- [x] **I have read the [contribution guidelines](../CONTRIBUTING.md).**

## General Guidelines and Best Practices
- [x] Title of the pull request is clear and informative.
- [x] 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
- [x] Pull request includes test coverage for the included changes.
  • Loading branch information
elliotzh authored Aug 29, 2023
1 parent b0a0900 commit 1345b75
Showing 1 changed file with 5 additions and 12 deletions.
17 changes: 5 additions & 12 deletions .github/workflows/check_enforcer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,10 @@ name: GitHub Event Handler
on:
check_suite:
types: [completed]
issue_comment:
types: [created]

env:
# note that this should be ${{ github.event.pull_request.head.sha }} for pull_request events
head_sha: ${{ github.sha }}
head_sha: ${{ github.event.check_suite.head_sha }}

jobs:
event-handler:
Expand All @@ -35,18 +33,13 @@ jobs:
- name: Summarize check status
id: summarize_check_status
run: |
incomplete_check_count=$(jq -c '.check_runs | .[] | .status | select (.!="completed")' status.json | wc -l)
echo "incomplete_check_count: $incomplete_check_count"
jq -c '.check_runs | .[] | select (.status!="completed") | .html_url' status.json | while read url; do
status="success"
jq -c '.check_runs | .[] | select (.conclusion!="success") | .html_url' status.json | while read url; do
echo $url
status="pending"
done
if [ $incomplete_check_count -gt 0 ]; then
echo "status=pending" >> "$GITHUB_OUTPUT"
else
echo "status=success" >> "$GITHUB_OUTPUT"
fi
echo "status=$status" >> "$GITHUB_OUTPUT"
- uses: octokit/[email protected]
name: Update the check enforcer status
Expand Down

0 comments on commit 1345b75

Please sign in to comment.