Skip to content

Update schema for ref main #858

Update schema for ref main

Update schema for ref main #858

Workflow file for this run

name: Schemas
run-name: Update schema for ref ${{ github.event.client_payload.ref || inputs.ref || 'main' }}
on:
workflow_dispatch: # Activate this workflow manually
inputs:
ref:
description: Tag or branch name of Haystack version
required: true
type: string
default: main
# Activate this workflow with an API call
# https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#repository_dispatch
repository_dispatch:
types: [generate-pipeline-schemas]
env:
HAYSTACK_REF: ${{ github.event.client_payload.ref || inputs.ref || 'main' }}
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
jobs:
run:
name: Update schema for ref ${{ github.event.client_payload.ref || inputs.ref || 'main' }}
runs-on: ubuntu-latest
steps:
- name: Validate release
id: validate
# Silently discard docker releases for test purposes to not publish schema files for them, while avoiding a red CI.
continue-on-error: true
run: |
echo "${HAYSTACK_REF}" | egrep '^main|v[0-9]+\.[0-9]+\.[0-9]+$'
- if: steps.validate.outcome == 'success'
name: Checkout
uses: actions/checkout@v3
- if: steps.validate.outcome == 'success'
name: Update schema
run: |
docker run -t -v "${PWD}:/haystack-json-schema" "docker.io/deepset/haystack:base-cpu-${HAYSTACK_REF}" python /haystack-json-schema/.github/utils/generate_json_schema.py
- if: steps.validate.outcome == 'success'
name: Commit files
run: |
git status
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git add .
if [ "${HAYSTACK_REF}" != "main" ]; then
git restore --staged --worktree json-schema/haystack-pipeline-main.schema.json
fi
git commit -m "Update Schema for ${HAYSTACK_REF}" -a || echo "No changes to commit"
git push
- uses: act10ns/slack@v1
with:
status: ${{ job.status }}
channel: '#haystack'
if: steps.validate.outcome == 'success' && failure() && github.repository_owner == 'deepset-ai' && github.ref == 'refs/heads/main'