Skip to content

Pushed by mite-bot #1393

Pushed by mite-bot

Pushed by mite-bot #1393

name: Validate MITE JSON entry
run-name: Pushed by ${{ github.actor }}
permissions:
contents: read
on:
pull_request:
branches:
- main
paths:
- "mite_data/data/**"
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v5
with:
fetch-depth: 2
- name: Install uv
uses: astral-sh/setup-uv@v6
with:
enable-cache: true
cache-dependency-glob: "uv.lock"
- name: Set up Python
run: uv python install
- name: Install dependencies
run: uv sync --all-groups
- name: Validate MIBiG ref dataset
run: uv run python pipeline/validate_mibig.py
- name: Get changed MITE files
id: files
run: |
git fetch origin ${{ github.event.pull_request.base.ref }}
CHANGED=$(git diff --name-only --diff-filter=AM origin/${{ github.event.pull_request.base.ref }}...HEAD | grep -E '^mite_data/data/.+\.json$' || true)
{
echo "changed<<EOF"
echo "$CHANGED"
echo "EOF"
} >> "$GITHUB_OUTPUT"
- name: Run validation scripts on MITE .json files
if: ${{ steps.files.outputs.changed != '' }}
run: |
echo "Running validation on changed .json files:"
while IFS= read -r file; do
echo " -> $file"
uv run python pipeline/validate_entry.py "$file"
done <<< "${{ steps.files.outputs.changed }}"