Skip to content
Merged
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
38 changes: 38 additions & 0 deletions .github/workflows/basic-pr-checks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: "Basic PR checks"
permissions: read-all

on:
pull_request

jobs:
disallow-submodules:
runs-on: ubuntu-22.04
steps:
- name: Checkout repository
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.2
- name: Check for submodules
run: |
output=$(git submodule status --recursive 2>&1)
if [ ! -z $output ]; then
echo $output
echo "Submodules are not allowed"
exit 1
else
echo "No submodules found"
fi
disallow-large-prs:
runs-on: ubuntu-22.04
steps:
- name: Check PR size
run: |
response=$(curl --get -Ss -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" -H "Accept: application/vnd.github.v3+json" "https://api.github.com/repos/${{ github.repository }}/pulls/${{github.event.pull_request.number}}")
additions=$(echo "$response" | jq -r '.additions')
deletions=$(echo "$response" | jq -r '.deletions')
total=$(( $additions + $deletions ))
echo "$additions lines added; $deletions lines deleted"
if (( $total > 500 )); then
echo "This PR changed $total lines of code, which is above the recommended limit of 500. Your reviewer may ask you to break it into multiple PRs."
exit 1
else
echo "This PR changed $total lines of code, which meets the recommended limit of 500."
fi
22 changes: 0 additions & 22 deletions .github/workflows/disallow-submodules.yml

This file was deleted.

Loading