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

chore: github repository configuration #91

Merged
merged 18 commits into from
Jun 3, 2024
Merged
Show file tree
Hide file tree
Changes from 7 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
5 changes: 0 additions & 5 deletions .dockerignore

This file was deleted.

1 change: 1 addition & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @cowprotocol/contracts
9 changes: 0 additions & 9 deletions .github/dependabot.yml

This file was deleted.

13 changes: 9 additions & 4 deletions .github/pull_request_template.md
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) -->
25 changes: 0 additions & 25 deletions .github/workflows/CI.yml → .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,28 +36,3 @@ jobs:
with:
github-token: ${{ secrets.GITHUB_TOKEN }}

docker-deploy:
runs-on: ubuntu-latest
needs: test
if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/')
steps:
- uses: actions/checkout@v3
- uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Image metadata
id: meta
uses: docker/metadata-action@v4
with:
images: ghcr.io/${{ github.repository }}
labels: |
org.opencontainers.image.licenses=LGPL-3.0-or-later
- uses: docker/build-push-action@v3
with:
context: .
file: src/docker/Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
56 changes: 56 additions & 0 deletions .github/workflows/review-check.yml
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
Copy link
Contributor

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bumped all to latest.


- 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!"
24 changes: 0 additions & 24 deletions .mergify.yml

This file was deleted.

16 changes: 0 additions & 16 deletions src/docker/Dockerfile

This file was deleted.

Loading