-
Notifications
You must be signed in to change notification settings - Fork 36
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
chore: github repository configuration #91
Merged
Merged
Changes from 7 commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
662580e
chore: add codeowners
mfw78 be2fc52
chore: rm dependabot
mfw78 8250417
chore: remove docker
mfw78 3eccbac
chore: rm mergify
mfw78 bb2e5fd
chore: ensure double-code reviews for src
mfw78 f0e6e23
chore: minor pull request template update
mfw78 fe4be93
fix: only guard src for review-check
mfw78 8de6836
chore: bump github actions
mfw78 56f9a6b
fix: only count approved and non-dismissed reviews
mfw78 772e8b1
fix: extraneous fi in shell script
mfw78 4f6a045
fix: exit on error in shell
mfw78 496abc4
fix: git diff comparison
mfw78 1669442
refactor: specify shell for default exit on error
mfw78 187b46f
test: failing check
mfw78 1d3af70
fix: bad path grep
mfw78 787aea7
fix: remove test artifact
mfw78 68689ad
chore: review check on contracts-specific folder
mfw78 9afb102
fix: reviewer uniqueness check
mfw78 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
* @cowprotocol/contracts |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,12 @@ | ||
Closes #issue (optional) | ||
## Description | ||
|
||
_<Context of what this change does, why it is needed and how it is accomplished>_ | ||
<!-- Describe the changes made in your pull request here - what this change does, why it is needed and how it is accomplished --> | ||
|
||
### Test Plan | ||
## Test Plan | ||
|
||
_<Explain how you and a reviewer have/intend to test this change>_ | ||
<!-- Explain how you and a reviewer have/intend to test this change --> | ||
|
||
## Related Issues | ||
|
||
<!-- List related issues here --> | ||
<!-- Closes #issue (optional) --> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
name: Enforce Review Rules | ||
|
||
on: | ||
pull_request: | ||
types: [opened, edited, synchronize] | ||
|
||
jobs: | ||
enforce-review-rules: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Get list of files changed | ||
id: files | ||
run: | | ||
echo "::set-output name=files::$(git diff --name-only ${{ github.event.before }} ${{ github.sha }} | tr '\n' ' ')" | ||
mfw78 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
- name: Check if PR modifies specific path | ||
id: check-path | ||
run: | | ||
if echo "${{ steps.files.outputs.files }}" | grep -q '^src/'; then | ||
echo "::set-output name=specific_path::true" | ||
else | ||
echo "::set-output name=specific_path::false" | ||
fi | ||
mfw78 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
- name: Ensure required reviewers | ||
id: ensure-reviewers | ||
run: | | ||
GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }} | ||
PR_NUMBER=${{ github.event.pull_request.number }} | ||
REPO=${{ github.repository }} | ||
|
||
# Fetch reviewers of the PR | ||
REVIEWERS=$(curl -s -H "Authorization: token $GITHUB_TOKEN" \ | ||
"https://api.github.com/repos/$REPO/pulls/$PR_NUMBER/reviews" \ | ||
| jq -r '.[].user.login') | ||
mfw78 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
NUM_REVIEWERS=$(echo "$REVIEWERS" | wc -w) | ||
mfw78 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
# Check review requirements | ||
if [ "${{ steps.check-path.outputs.specific_path }}" == "true" ]; then | ||
if [ "$NUM_REVIEWERS" -lt 2 ]; then | ||
echo "Insufficient reviewers for src/ path. Required: 2 reviewers." | ||
echo "::set-output name=review_check_passed::false" | ||
exit 1 | ||
fi | ||
fi | ||
|
||
echo "::set-output name=review_check_passed::true" | ||
|
||
- name: Success message | ||
if: success() | ||
run: echo "Review checks passed successfully!" |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Other actions in this repo use checkout@v3. I don't know the difference between the two, but for consistency it makes sense to keep v3 here as well.
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.
Bumped all to latest.