-
Notifications
You must be signed in to change notification settings - Fork 0
39 lines (36 loc) · 1.41 KB
/
Copy pathvalidate.yml
File metadata and controls
39 lines (36 loc) · 1.41 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
name: Validate bot submission
on:
pull_request:
paths:
- bots/**
- scripts/**
- .github/workflows/validate.yml
permissions:
contents: read
jobs:
validate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-python@v5
with:
python-version: '3.12'
# Java bots run from source (Java 22+ multi-file launch); match the Rumble's JVM.
- uses: actions/setup-java@v4
with:
distribution: temurin
java-version: '25'
- run: python -m unittest discover -s tests -v
- name: Reject hand-edited generated catalog files
run: |
if git cat-file -e origin/${{ github.base_ref }}:bots/index.json 2>/dev/null && git diff --name-only origin/${{ github.base_ref }}...HEAD | grep -qx 'bots/index.json'; then
echo 'bots/index.json is generated by CI and cannot be edited in a pull request.'
exit 1
fi
if git cat-file -e origin/${{ github.base_ref }}:bots/owners.json 2>/dev/null && git diff --name-only origin/${{ github.base_ref }}...HEAD | grep -qx 'bots/owners.json'; then
echo 'bots/owners.json is generated by CI and cannot be edited in a pull request.'
exit 1
fi
- run: python scripts/validate_bot.py --root . --owner '${{ github.event.pull_request.user.login }}' --smoke