Skip to content

Commit

Permalink
Add more
Browse files Browse the repository at this point in the history
Signed-off-by: Peter Zhu <[email protected]>
  • Loading branch information
peterzhuamazon committed Sep 30, 2024
1 parent 6e9abce commit 412fdcf
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 11 deletions.
Binary file removed .github/workflows/.require-approval.yml.swp
Binary file not shown.
10 changes: 5 additions & 5 deletions .github/workflows/CI-workflow.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
name: Build and Test ml-commons
# This workflow is triggered on pull requests and push to any branches
on:
# push:
# branches-ignore:
# - 'backport/**'
# - 'create-pull-request/**'
# - 'dependabot/**'
push:
branches-ignore:
- 'backport/**'
- 'create-pull-request/**'
- 'dependabot/**'
pull_request_target:
types: [opened, synchronize, reopened]

Expand Down
18 changes: 12 additions & 6 deletions .github/workflows/require-approval.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,18 @@ jobs:
- name: Get CodeOwner List
id: step-is-require-approval
run: |
approvers=$(cat .github/CODEOWNERS | grep @ | tr -d '* ' | sed 's/@/,/g' | sed 's/,//1')
author=${{ github.event.pull_request.user.login }}
if [[ "$approvers" =~ "$author" ]]; then
echo "$authoer is in the approval list"
github_event = $${{ github.event_name }}
if [[ "$github_event" = "push" ]]; then
echo "Push event does not need approval"
echo "is-require-approval=ml-commons-cicd-env" >> $GITHUB_OUTPUT
else
echo "$author is not in the approval list"
echo "is-require-approval=ml-commons-cicd-env-require-approval" >> $GITHUB_OUTPUT
approvers=$(cat .github/CODEOWNERS | grep @ | tr -d '* ' | sed 's/@/,/g' | sed 's/,//1')
author=${{ github.event.pull_request.user.login }}
if [[ "$approvers" =~ "$author" ]]; then
echo "$authoer is in the approval list"
echo "is-require-approval=ml-commons-cicd-env" >> $GITHUB_OUTPUT
else
echo "$author is not in the approval list"
echo "is-require-approval=ml-commons-cicd-env-require-approval" >> $GITHUB_OUTPUT
fi
fi

0 comments on commit 412fdcf

Please sign in to comment.