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: prevent stage0 updates from being merged using the merge queue #2

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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
37 changes: 16 additions & 21 deletions .github/workflows/check-prelude.yml
Original file line number Diff line number Diff line change
@@ -1,26 +1,21 @@
name: Check for modules that should use `prelude`
name: Check for copyright header

on: [pull_request]
on: [merge_group]

jobs:
check-prelude:
check-lean-files:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
# the default is to use a virtual merge commit between the PR and master: just use the PR
ref: ${{ github.event.pull_request.head.sha }}
sparse-checkout: src/Lean
- name: Check Prelude
run: |
failed_files=""
while IFS= read -r -d '' file; do
if ! grep -q "^prelude$" "$file"; then
failed_files="$failed_files$file\n"
fi
done < <(find src/Lean -name '*.lean' -print0)
if [ -n "$failed_files" ]; then
echo -e "The following files should use 'prelude':\n$failed_files"
exit 1
fi
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
- name:
run: |
if git diff HEAD^..HEAD --name-only -- stage0 |
grep -v -x -F stage0/src/stdlib_flags.h |
grep -v -x -F stage0/src/lean.mk.in |
grep -q .
then
echo "Found stage0 updates, please do not merge using the merge queue" | tee "$GITHUB_STEP_SUMMARY"
exit 1
fi
Loading