-
Notifications
You must be signed in to change notification settings - Fork 138
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Test Env Require Approval Action #3005
Conversation
Adding @ylwu-amzn @dhrubo-os to take a look. Note you need to merge this PR before it take effect as it is Pull_Request_Target event. Thanks. |
Signed-off-by: Peter Zhu <zhujiaxi@amazon.com>
echo "Push event does not need approval" | ||
echo "is-require-approval=ml-commons-cicd-env" >> $GITHUB_OUTPUT | ||
else | ||
approvers=$(cat .github/CODEOWNERS | grep @ | tr -d '* ' | sed 's/@/,/g' | sed 's/,//1') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So currently, it's maintainers vs non-maintainers, right?
not maintainers + organization vs non-maintainers?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it is easier to get maintainers list, we will start from here and improve.
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" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nit] author
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated, thanks.
Signed-off-by: Peter Zhu <zhujiaxi@amazon.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks Peter for enhancing this
* Add require approval stage so only maintainers can start CI stage without approval Signed-off-by: Peter Zhu <zhujiaxi@amazon.com> * Add more Signed-off-by: Peter Zhu <zhujiaxi@amazon.com> * Add more Signed-off-by: Peter Zhu <zhujiaxi@amazon.com> * Add old files Signed-off-by: Peter Zhu <zhujiaxi@amazon.com> * Update require-approval.yml Signed-off-by: Peter Zhu <zhujiaxi@amazon.com> --------- Signed-off-by: Peter Zhu <zhujiaxi@amazon.com> (cherry picked from commit 9de2d23)
* Add require approval stage so only maintainers can start CI stage without approval Signed-off-by: Peter Zhu <zhujiaxi@amazon.com> * Add more Signed-off-by: Peter Zhu <zhujiaxi@amazon.com> * Add more Signed-off-by: Peter Zhu <zhujiaxi@amazon.com> * Add old files Signed-off-by: Peter Zhu <zhujiaxi@amazon.com> * Update require-approval.yml Signed-off-by: Peter Zhu <zhujiaxi@amazon.com> --------- Signed-off-by: Peter Zhu <zhujiaxi@amazon.com> (cherry picked from commit 9de2d23) Co-authored-by: Peter Zhu <zhujiaxi@amazon.com>
Description
Add Test Env Require Approval Action.
Every time when a PR get created:
.github/CODEOWNERS
, assignml-commons-cicd-env-required-approval
, pending for review by the assigned maintainers of the env.ml-commons-cicd-env
, no need approval.ml-commons-cicd-env
assigned, no need approval.Example waiting for approval by maintainer: #3004.
Thanks.
Related Issues
Resolves #[Issue number to be closed when this PR is merged]
Check List
--signoff
.By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.