Skip to content

Commit

Permalink
Update schemas.yml to change the default from main to v1.x
Browse files Browse the repository at this point in the history
  • Loading branch information
ZanSara authored Dec 19, 2023
1 parent 2e8bcd2 commit a9df564
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions .github/workflows/schemas.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: Schemas
run-name: Update schema for ref ${{ github.event.client_payload.ref || inputs.ref || 'main' }}
run-name: Update schema for ref ${{ github.event.client_payload.ref || inputs.ref || 'v1.x' }}

on:
workflow_dispatch: # Activate this workflow manually
Expand All @@ -8,21 +8,21 @@ on:
description: Tag or branch name of Haystack version
required: true
type: string
default: main
default: v1.x

# 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' }}
HAYSTACK_REF: ${{ github.event.client_payload.ref || inputs.ref || 'v1.x' }}
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}

jobs:

run:
name: Update schema for ref ${{ github.event.client_payload.ref || inputs.ref || 'main' }}
name: Update schema for ref ${{ github.event.client_payload.ref || inputs.ref || 'v1.x' }}
runs-on: ubuntu-latest
steps:

Expand All @@ -31,7 +31,7 @@ jobs:
# 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]+$'
echo "${HAYSTACK_REF}" | egrep '^v1.x|v[0-9]+\.[0-9]+\.[0-9]+$'
- if: steps.validate.outcome == 'success'
name: Checkout
Expand All @@ -49,7 +49,7 @@ jobs:
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
if [ "${HAYSTACK_REF}" != "v1.x" ]; 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"
Expand All @@ -59,4 +59,4 @@ jobs:
with:
status: ${{ job.status }}
channel: '#haystack'
if: steps.validate.outcome == 'success' && failure() && github.repository_owner == 'deepset-ai' && github.ref == 'refs/heads/main'
if: steps.validate.outcome == 'success' && failure() && github.repository_owner == 'deepset-ai' && github.ref == 'refs/heads/v1.x'

0 comments on commit a9df564

Please sign in to comment.