Skip to content
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

Test Require Approval2 #3003

Closed
wants to merge 13 commits into from
Binary file added .github/workflows/.require-approval.yml.swp
Binary file not shown.
364 changes: 184 additions & 180 deletions .github/workflows/CI-workflow.yml

Large diffs are not rendered by default.

19 changes: 0 additions & 19 deletions .github/workflows/add-untriaged.yml

This file was deleted.

28 changes: 0 additions & 28 deletions .github/workflows/auto-release.yml

This file was deleted.

28 changes: 0 additions & 28 deletions .github/workflows/backport.yml

This file was deleted.

15 changes: 0 additions & 15 deletions .github/workflows/delete_backport_branch.yml

This file was deleted.

20 changes: 0 additions & 20 deletions .github/workflows/draft-release-notes-workflow.yml

This file was deleted.

26 changes: 0 additions & 26 deletions .github/workflows/labeler.yml

This file was deleted.

38 changes: 0 additions & 38 deletions .github/workflows/maven-publish.yml

This file was deleted.

30 changes: 30 additions & 0 deletions .github/workflows/require-approval.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
---
name: Check if the workflow require approval
on:
workflow_call:
outputs:
is-require-approval:
description: The ci image version for linux build
value: ${{ jobs.Require-Approval.outputs.output-is-require-approval }}

jobs:
Require-Approval:
runs-on: ubuntu-latest
outputs:
output-is-require-approval: ${{ steps.step-is-require-approval.outputs.is-require-approval }}
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.base.sha }}
- 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"
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
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
test123
[![Test Workflow](https://github.com/opensearch-project/ml-commons/workflows/Build%20and%20Test%20ml-commons/badge.svg)](https://github.com/opensearch-project/ml-commons/actions)
[![codecov](https://codecov.io/gh/opensearch-project/ml-commons/branch/main/graph/badge.svg)](https://codecov.io/gh/opensearch-project/ml-commons)
[![Documentation](https://img.shields.io/badge/api-reference-blue.svg)](https://opensearch.org/docs/latest/ml-commons-plugin/api/)
Expand Down
Loading