diff --git a/.github/workflows/collectivex-results-ingest.yml b/.github/workflows/collectivex-results-ingest.yml new file mode 100644 index 0000000000..7222697e4c --- /dev/null +++ b/.github/workflows/collectivex-results-ingest.yml @@ -0,0 +1,47 @@ +name: CollectiveX Results Ingest +run-name: CollectiveX results ingest ${{ inputs.sha || github.sha }} + +# Committed CollectiveX results on main are the dashboard's source of truth. Each push that changes +# them asks InferenceX-app to load that commit into its CollectiveX database. + +on: + push: + branches: [main] + paths: + - "collectivex/results/**" + # Re-sends a commit by hand: one pushed before the app could receive it, or one whose ingest failed. + workflow_dispatch: + inputs: + sha: + description: "InferenceX commit whose collectivex/results to ingest (default: the dispatch ref)" + required: false + type: string + +permissions: {} + +concurrency: + group: collectivex-results-ingest-${{ inputs.sha || github.sha }} + cancel-in-progress: false + +jobs: + dispatch: + name: Trigger CollectiveX ingest + runs-on: ubuntu-latest + steps: + - name: Dispatch to InferenceX-app + uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 + env: + SHA: ${{ inputs.sha || github.sha }} + with: + github-token: ${{ secrets.FRONTEND_PAT }} # zizmor: ignore[secrets-outside-env] + script: | + if (!/^[0-9a-f]{40}$/.test(process.env.SHA)) { + core.setFailed(`not a full commit SHA: ${process.env.SHA}`); + return; + } + await github.rest.repos.createDispatchEvent({ + owner: "SemiAnalysisAI", + repo: "InferenceX-app", + event_type: "ingest-collectivex", + client_payload: { sha: process.env.SHA }, + });