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

doNotMerge: Test review check #996

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions .github/workflows/check-reviews.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Check Reviews

on:
pull_request:
types: [opened, edited, reopened]

jobs:
review-check:
runs-on: ubuntu-latest
steps:
- name: Check for required reviews
uses: actions/github-script@v6
with:
script: |
try {
console.log('GitHub context:', context);
const { pull_request } = context.payload;
const reviews = await github.pulls.listReviews({
owner: context.repo.owner,
repo: context.repo.repo,
pull_number: pull_request.number,
});
const approvedReviews = reviews.data.filter(review => review.state === 'APPROVED');
if (approvedReviews.length === 0) {
throw new Error('This pull request requires at least one approved review before merging.');
}
} catch (error) {
console.error('Error fetching reviews:', error);
throw new Error('Failed to check reviews: ' + error.message);
}

1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -150,3 +150,4 @@ $ docker push <some-registry>/<namespace>/quay-operator-index:dev
```sh
$ kubectl create -n openshift-marketplace -f ./bundle/quay-operator.catalogsource.yaml
```
# Test Change
Loading