Skip to content

Confine asset servlet paths to the resource root (#38590) #1

Confine asset servlet paths to the resource root (#38590)

Confine asset servlet paths to the resource root (#38590) #1

name: Warm classification models
on:
push:
branches: [main]
paths:
- ingestion/pyproject.toml
- ingestion/uv.lock
- scripts/prepare_classification_models.py
- .github/actions/prepare-classification-models/**
- .github/actions/prepare-classification-model/**
- .github/workflows/warm-classification-models.yml
workflow_dispatch:
inputs:
revision:
description: Exact commit SHA; leave empty to warm main
type: string
default: ''
schedule:
- cron: '15 5 * * *'
permissions:
contents: read
concurrency:
group: classification-model-warmer
queue: single
cancel-in-progress: false
jobs:
warm:
if: ${{ github.ref == format('refs/heads/{0}', github.event.repository.default_branch) }}
runs-on: ubuntu-24.04
cache-mode: write
timeout-minutes: 15
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
with:
ref: ${{ github.event.repository.default_branch }}
persist-credentials: false
- id: metadata
env:
REQUESTED_REVISION: ${{ inputs.revision || github.sha }}
run: |
if [[ ! "$REQUESTED_REVISION" =~ ^[a-f0-9]{40}$ ]]; then
echo "Expected an exact commit SHA" >&2
exit 1
fi
if ! git cat-file -e "$REQUESTED_REVISION:ingestion/pyproject.toml"; then
git fetch --no-tags --depth=1 origin "$REQUESTED_REVISION"
fi
project=$(mktemp -d "$RUNNER_TEMP/classification-metadata.XXXXXX")
git show "$REQUESTED_REVISION:ingestion/pyproject.toml" > "$project/pyproject.toml"
echo "project=$project" >> "$GITHUB_OUTPUT"
- uses: ./.github/actions/prepare-classification-models
with:
project: ${{ steps.metadata.outputs.project }}
save-cache: 'true'