Skip to content

fix(python): use endpoint ID for wire test snippet generation (#11470) #5239

fix(python): use endpoint ID for wire test snippet generation (#11470)

fix(python): use endpoint ID for wire test snippet generation (#11470) #5239

Workflow file for this run

name: Update Seed
on:
push:
branches:
- main
workflow_dispatch:
inputs:
language:
description: 'Language to run seed for (leave as "all" to run all languages)'
required: false
default: "all"
type: choice
options:
- all
- typescript
- python
- java
- go
- csharp
- php
- swift
- rust
- ruby
- openapi
- postman
commit-on-failure:
description: 'Commit successful seed changes even if some seed runs fail'
required: false
default: false
type: boolean
skip-scripts:
description: 'Skip running compile/test scripts during seed generation'
required: false
default: false
type: boolean
# Cancel previous workflows on previous push
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
# These scope secrets.GITHUB_TOKEN
permissions:
pull-requests: write
contents: write
env:
DOCKER_BUILDKIT: 1
jobs:
setup:
if: github.repository == 'fern-api/fern'
runs-on: ubuntu-latest
timeout-minutes: 2
outputs:
skip-scripts: ${{ steps.set-update-options.outputs.skip-scripts }}
update-by-push: ${{ steps.set-update-options.outputs.update-by-push }}
update-by-pr: ${{ steps.set-update-options.outputs.update-by-pr }}
selected-language: ${{ steps.set-language-filter.outputs.selected-language }}
commit-on-failure: ${{ steps.set-commit-on-failure.outputs.commit-on-failure }}
steps:
# Apply by direct push for workflow_dispatches that aren't on main, apply by PR if running against main
- name: Set update options
id: set-update-options
shell: bash
run: |
if [[ "${{ github.event_name }}" == "workflow_dispatch" && "${{ github.ref }}" != "refs/heads/main" ]]; then
echo "skip-scripts=true" >> $GITHUB_OUTPUT
echo "update-by-push=true" >> $GITHUB_OUTPUT
echo "update-by-pr=false" >> $GITHUB_OUTPUT
else
# For workflow_dispatch, check if skip-scripts checkbox is checked
# For push events, default to false
if [[ "${{ github.event_name }}" == "workflow_dispatch" && "${{ github.event.inputs.skip-scripts }}" == "true" ]]; then
echo "skip-scripts=true" >> $GITHUB_OUTPUT
else
echo "skip-scripts=false" >> $GITHUB_OUTPUT
fi
echo "update-by-push=false" >> $GITHUB_OUTPUT
echo "update-by-pr=true" >> $GITHUB_OUTPUT
fi
- name: Set language filter
id: set-language-filter
shell: bash
run: |
# For workflow_dispatch events, use the input language filter
# For push events, default to 'all' to maintain existing behavior
if [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then
SELECTED_LANGUAGE="${{ github.event.inputs.language }}"
echo "Language filter from workflow_dispatch input: $SELECTED_LANGUAGE"
else
SELECTED_LANGUAGE="all"
echo "Push event detected, running all languages"
fi
echo "selected-language=$SELECTED_LANGUAGE" >> $GITHUB_OUTPUT
- name: Set commit-on-failure option
id: set-commit-on-failure
shell: bash
run: |
# For workflow_dispatch events, use the input commit-on-failure option
# For push events, default to 'false' to maintain existing behavior
if [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then
COMMIT_ON_FAILURE="${{ github.event.inputs.commit-on-failure }}"
echo "Commit on failure option from workflow_dispatch input: $COMMIT_ON_FAILURE"
else
COMMIT_ON_FAILURE="false"
echo "Push event detected, defaulting commit-on-failure to false"
fi
echo "commit-on-failure=$COMMIT_ON_FAILURE" >> $GITHUB_OUTPUT
changes:
if: github.repository == 'fern-api/fern'
runs-on: ubuntu-latest
timeout-minutes: 5
strategy:
matrix:
generator-name: [seed, ruby, ruby-v2, openapi, python, postman, java, typescript, go, csharp, php, swift, rust]
include:
- files: |
packages/seed/
packages/ir-sdk/fern/apis/
packages/cli/generation/ir-generator/
test-definitions/
test-definitions-openapi/
generator-name: seed
- files: |
generators/ruby/
seed/ruby-sdk/
seed/ruby-model/
generator-name: ruby
- files: |
generators/ruby-v2/
seed/ruby-sdk-v2/
generator-name: ruby-v2
- files: |
generators/openapi/
seed/openapi/
generator-name: openapi
- files: |
generators/python/
generators/python-v2/
seed/pydantic/
seed/pydantic-v2/
seed/python-sdk/
seed/fastapi/
generator-name: python
- files: |
generators/postman/
seed/postman/
generator-name: postman
- files: |
generators/java/
generators/java-v2/
seed/java-sdk/
seed/java-model/
seed/java-spring/
generator-name: java
- files: |
generators/typescript/
generators/typescript-v2/
seed/ts-sdk/
seed/ts-express/
generator-name: typescript
- files: |
generators/go/
generators/go-v2/
seed/go-sdk/
seed/go-model/
seed/go-fiber/
generator-name: go
- files: |
generators/csharp/
seed/csharp-sdk/
seed/csharp-model/
generator-name: csharp
- files: |
generators/php/
seed/php-sdk/
seed/php-model/
generator-name: php
- files: |
generators/swift/
seed/swift-sdk/
generator-name: swift
- files: |
generators/rust/
seed/rust-model/
seed/rust-sdk/
generator-name: rust
outputs:
seed: ${{ steps.set-output.outputs.seed-changes }}
ruby: ${{ steps.set-output.outputs.ruby-changes }}
ruby-v2: ${{ steps.set-output.outputs.ruby-v2-changes }}
openapi: ${{ steps.set-output.outputs.openapi-changes }}
python: ${{ steps.set-output.outputs.python-changes }}
postman: ${{ steps.set-output.outputs.postman-changes }}
java: ${{ steps.set-output.outputs.java-changes }}
typescript: ${{ steps.set-output.outputs.typescript-changes }}
go: ${{ steps.set-output.outputs.go-changes }}
csharp: ${{ steps.set-output.outputs.csharp-changes }}
php: ${{ steps.set-output.outputs.php-changes }}
swift: ${{ steps.set-output.outputs.swift-changes }}
rust: ${{ steps.set-output.outputs.rust-changes }}
steps:
- name: Checkout Files
uses: actions/checkout@v4
with:
# Get sufficient history to check for changes
fetch-depth: 0
sparse-checkout: |
${{ matrix.files }}
.github/
- name: Setup Base SHA
id: setup-base-sha
run: |
BASE_SHA=""
# For workflow_dispatch events that aren't on main, find the last commit from the main branch and compare against that
# For workflows involving the main branch, compare to the last commit
if [[ "${{ github.event_name }}" == "workflow_dispatch" && "${{ github.ref }}" != "refs/heads/main" ]]; then
git fetch origin main
MERGE_BASE=$(git merge-base HEAD origin/main)
echo "Merge base commit: $MERGE_BASE"
BASE_SHA=$MERGE_BASE
elif [[ ("${{ github.event_name }}" == "workflow_dispatch" && "${{ github.ref }}" == "refs/heads/main") || \
("${{ github.event_name }}" == "push" && "${{ github.ref }}" == "refs/heads/main") ]]; then
PREVIOUS_MAIN_COMMIT=$(git rev-parse origin/main^)
echo "Previous commit on main: $PREVIOUS_MAIN_COMMIT"
BASE_SHA=$PREVIOUS_MAIN_COMMIT
else
echo "Unexpected event and branch combination. Event: ${{ github.event_name }}, Branch: ${{ github.ref }}"
exit 1
fi
echo "base_sha=$BASE_SHA" >> $GITHUB_OUTPUT
- name: Get generator changes for ${{ matrix.generator-name }}
id: get-generator-changes
uses: ./.github/actions/check-for-changed-files
with:
base_sha: ${{ steps.setup-base-sha.outputs.base_sha }}
files: ${{ matrix.files }}
- name: Set output
id: set-output
run: |
echo "${{ matrix.generator-name }}-changes=${{ steps.get-generator-changes.outputs.any_changed }}" >> $GITHUB_OUTPUT
get-all-test-matrices:
runs-on: ubuntu-latest
timeout-minutes: 10
strategy:
fail-fast: false # Don't let failing generators block the passing generators
matrix:
sdk-name:
[
ruby-model,
ruby-sdk,
ruby-sdk-v2,
pydantic,
python-sdk,
fastapi,
openapi,
postman,
java-sdk,
java-model,
java-spring,
ts-sdk,
ts-express,
go-fiber,
go-model,
go-sdk,
csharp-model,
csharp-sdk,
php-model,
php-sdk,
swift-sdk,
rust-model,
rust-sdk
]
outputs:
ruby-model: ${{ steps.create-seed-groups-matrix.outputs.ruby-model-test-matrix }}
ruby-sdk: ${{ steps.create-seed-groups-matrix.outputs.ruby-sdk-test-matrix }}
ruby-sdk-v2: ${{ steps.create-seed-groups-matrix.outputs.ruby-sdk-v2-test-matrix }}
pydantic: ${{ steps.create-seed-groups-matrix.outputs.pydantic-test-matrix }}
python-sdk: ${{ steps.create-seed-groups-matrix.outputs.python-sdk-test-matrix }}
fastapi: ${{ steps.create-seed-groups-matrix.outputs.fastapi-test-matrix }}
openapi: ${{ steps.create-seed-groups-matrix.outputs.openapi-test-matrix }}
postman: ${{ steps.create-seed-groups-matrix.outputs.postman-test-matrix }}
java-sdk: ${{ steps.create-seed-groups-matrix.outputs.java-sdk-test-matrix }}
java-model: ${{ steps.create-seed-groups-matrix.outputs.java-model-test-matrix }}
java-spring: ${{ steps.create-seed-groups-matrix.outputs.java-spring-test-matrix }}
ts-sdk: ${{ steps.create-seed-groups-matrix.outputs.ts-sdk-test-matrix }}
ts-express: ${{ steps.create-seed-groups-matrix.outputs.ts-express-test-matrix }}
go-fiber: ${{ steps.create-seed-groups-matrix.outputs.go-fiber-test-matrix }}
go-model: ${{ steps.create-seed-groups-matrix.outputs.go-model-test-matrix }}
go-sdk: ${{ steps.create-seed-groups-matrix.outputs.go-sdk-test-matrix }}
csharp-model: ${{ steps.create-seed-groups-matrix.outputs.csharp-model-test-matrix }}
csharp-sdk: ${{ steps.create-seed-groups-matrix.outputs.csharp-sdk-test-matrix }}
php-model: ${{ steps.create-seed-groups-matrix.outputs.php-model-test-matrix }}
php-sdk: ${{ steps.create-seed-groups-matrix.outputs.php-sdk-test-matrix }}
swift-sdk: ${{ steps.create-seed-groups-matrix.outputs.swift-sdk-test-matrix }}
rust-model: ${{ steps.create-seed-groups-matrix.outputs.rust-model-test-matrix }}
rust-sdk: ${{ steps.create-seed-groups-matrix.outputs.rust-sdk-test-matrix }}
steps:
- name: Checkout repo
uses: actions/checkout@v4
with:
sparse-checkout: |
.github/workflow-resource-files/seed-groups/
- name: Verify Seed Groups File Exists
run: |
if [ ! -f .github/workflow-resource-files/seed-groups/${{ matrix.sdk-name }}-seed-groups.json ]; then
echo "${{ matrix.sdk-name }}-seed-groups.json file not found. This file should be created automatically by the nightly-seed-grouping workflow."
exit 1
else
echo "${{ matrix.sdk-name }}-seed-groups.json file found."
fi
- name: Determine Parallelization
id: determine-parallelization
run: |
# Note: these times are the total time of generation and compilation for all seed tests. This is not a
# measurement of throughput because it does not account of concurrency or parallelization. This is not
# a perfect representation, but it gets the job done. 3800 seconds was chosen as it is approximately
# 8 minutes when running with 16 concurrent tests as is our default setting in CI.
CUTOFF_TIME_FOR_PARALLELIZATION_SECONDS=3800
TOTAL_TEST_TIME_SECONDS=$(jq '.totalTestTimeSeconds' .github/workflow-resource-files/seed-groups/${{ matrix.sdk-name }}-seed-groups.json)
echo "Checking if ${{ matrix.sdk-name }} total test time of $TOTAL_TEST_TIME_SECONDS seconds is greater than $CUTOFF_TIME_FOR_PARALLELIZATION_SECONDS seconds to split tests into parallel runners"
# Validate both times are non-negative integers (zero is allowed)
if [[ ! $CUTOFF_TIME_FOR_PARALLELIZATION_SECONDS =~ ^[0-9]+$ ]]; then
echo "Cut off time from seed.yml workflow is not a non-negative integer ($CUTOFF_TIME_FOR_PARALLELIZATION_SECONDS)"
exit 1
fi
if [[ ! $TOTAL_TEST_TIME_SECONDS =~ ^[0-9]+$ ]]; then
echo "Total test time from ${{ matrix.sdk-name }}-seed-groups.json is not a non-negative integer ($TOTAL_TEST_TIME_SECONDS)"
exit 1
fi
# Determine if we should split tests into parallel runners based on the cutoff time
if [[ $TOTAL_TEST_TIME_SECONDS -gt $CUTOFF_TIME_FOR_PARALLELIZATION_SECONDS ]]; then
echo "Running ${{ matrix.sdk-name }} tests in parallel runners"
echo "split-tests=true" >> $GITHUB_OUTPUT
else
echo "Running ${{ matrix.sdk-name }} tests in a single runner"
echo "split-tests=false" >> $GITHUB_OUTPUT
fi
- name: Create Seed Groups Matrix
id: create-seed-groups-matrix
run: |
# Parallelize tests and add leftover test runner, or run all tests in a single runner
# Note: "leftovers" and "all" are used as keywords in the matrix jobs following this setup
BASH_VAR=""
if [[ "${{ steps.determine-parallelization.outputs.split-tests }}" == "true" ]]; then
echo "Using balanced groups from ${{ matrix.sdk-name }}-seed-groups.json and adding a group for any leftover tests"
BASH_VAR=$(jq '[.groups[] | {fixtures: .fixtures}]' .github/workflow-resource-files/seed-groups/${{ matrix.sdk-name }}-seed-groups.json)
WITH_LEFTOVERS=$(echo "$BASH_VAR" | jq -c '. += [{"fixtures": ["leftovers"]}]')
echo "${{ matrix.sdk-name }}-test-matrix=$WITH_LEFTOVERS" >> $GITHUB_OUTPUT
# Echo the data to command line for visibility
echo "Groups for ${{ matrix.sdk-name }}-test-matrix:"
echo "$WITH_LEFTOVERS" | jq .
else
echo "Using single group to run all ${{ matrix.sdk-name }} tests"
BASH_VAR='[{"fixtures":["all"]}]'
echo "${{ matrix.sdk-name }}-test-matrix=$BASH_VAR" >> $GITHUB_OUTPUT
# Echo the data to command line for visibility
echo "Single group for ${{ matrix.sdk-name }}-test-matrix:"
echo "$BASH_VAR" | jq .
fi
ruby-model-seed-update:
runs-on: ubuntu-latest
timeout-minutes: 60
needs: [changes, setup, get-all-test-matrices]
if: >-
${{
always() && !cancelled() &&
(needs.setup.outputs.selected-language == 'all' || needs.setup.outputs.selected-language == 'ruby') &&
(github.event_name == 'workflow_dispatch' || needs.changes.outputs.ruby == 'true' || needs.changes.outputs.seed == 'true') &&
needs.get-all-test-matrices.outputs.ruby-model != ''
}}
strategy:
fail-fast: false # Let all tests run for debug, won't end up applying changes with a failure
max-parallel: 15 # Limit the number of runners for this job
matrix:
include: ${{ fromJSON(needs.get-all-test-matrices.outputs.ruby-model) }}
steps:
- name: Checkout repo
uses: actions/checkout@v4
with:
sparse-checkout: |
.github/actions/
- name: Update seed
uses: ./.github/actions/auto-update-seed
with:
generator-name: ruby-model
generator-path: generators/ruby
allow-unexpected-failures: true
fixtures-to-run: ${{ toJson(matrix.fixtures) }}
index: ${{ strategy.job-index }}
skip-scripts: ${{ needs.setup.outputs.skip-scripts }}
ruby-sdk-seed-update:
runs-on: ubuntu-latest
timeout-minutes: 60
needs: [changes, setup, get-all-test-matrices]
if: >-
${{
always() && !cancelled() &&
(needs.setup.outputs.selected-language == 'all' || needs.setup.outputs.selected-language == 'ruby') &&
(github.event_name == 'workflow_dispatch' || needs.changes.outputs.ruby == 'true' || needs.changes.outputs.seed == 'true') &&
needs.get-all-test-matrices.outputs.ruby-sdk != ''
}}
strategy:
fail-fast: false # Let all tests run for debug, won't end up applying changes with a failure
max-parallel: 15 # Limit the number of runners for this job
matrix:
include: ${{ fromJSON(needs.get-all-test-matrices.outputs.ruby-sdk) }}
steps:
- name: Checkout repo
uses: actions/checkout@v4
with:
sparse-checkout: |
.github/actions/
- name: Update seed
uses: ./.github/actions/auto-update-seed
with:
generator-name: ruby-sdk
generator-path: generators/ruby
allow-unexpected-failures: true
fixtures-to-run: ${{ toJson(matrix.fixtures) }}
index: ${{ strategy.job-index }}
skip-scripts: ${{ needs.setup.outputs.skip-scripts }}
ruby-sdk-v2-seed-update:
runs-on: ubuntu-latest
timeout-minutes: 60
needs: [changes, setup, get-all-test-matrices]
if: >-
${{
always() && !cancelled() &&
(needs.setup.outputs.selected-language == 'all' || needs.setup.outputs.selected-language == 'ruby') &&
(github.event_name == 'workflow_dispatch' || needs.changes.outputs.ruby-v2 == 'true' || needs.changes.outputs.seed == 'true') &&
needs.get-all-test-matrices.outputs.ruby-sdk-v2 != ''
}}
strategy:
fail-fast: false # Let all tests run for debug, won't end up applying changes with a failure
max-parallel: 15 # Limit the number of runners for this job
matrix:
include: ${{ fromJSON(needs.get-all-test-matrices.outputs.ruby-sdk-v2) }}
steps:
- name: Checkout repo
uses: actions/checkout@v4
with:
sparse-checkout: |
.github/actions/
- name: Update seed
uses: ./.github/actions/auto-update-seed
with:
generator-name: ruby-sdk-v2
generator-path: generators/ruby-v2
allow-unexpected-failures: true
fixtures-to-run: ${{ toJson(matrix.fixtures) }}
index: ${{ strategy.job-index }}
skip-scripts: ${{ needs.setup.outputs.skip-scripts }}
pydantic-seed-update:
runs-on: ubuntu-latest
timeout-minutes: 60
needs: [changes, setup, get-all-test-matrices]
if: >-
${{
always() && !cancelled() &&
(needs.setup.outputs.selected-language == 'all' || needs.setup.outputs.selected-language == 'python') &&
(github.event_name == 'workflow_dispatch' || needs.changes.outputs.python == 'true' || needs.changes.outputs.seed == 'true') &&
needs.get-all-test-matrices.outputs.pydantic != ''
}}
strategy:
fail-fast: false # Let all tests run for debug, won't end up applying changes with a failure
max-parallel: 15 # Limit the number of runners for this job
matrix:
include: ${{ fromJSON(needs.get-all-test-matrices.outputs.pydantic) }}
steps:
- name: Checkout repo
uses: actions/checkout@v4
with:
sparse-checkout: |
.github/actions/
- name: Update seed
uses: ./.github/actions/auto-update-seed
with:
generator-name: pydantic
generator-path: generators/python generators/python-v2
allow-unexpected-failures: true
fixtures-to-run: ${{ toJson(matrix.fixtures) }}
index: ${{ strategy.job-index }}
skip-scripts: ${{ needs.setup.outputs.skip-scripts }}
python-sdk-seed-update:
runs-on: ubuntu-latest
timeout-minutes: 60
needs: [changes, setup, get-all-test-matrices]
if: >-
${{
always() && !cancelled() &&
(needs.setup.outputs.selected-language == 'all' || needs.setup.outputs.selected-language == 'python') &&
(github.event_name == 'workflow_dispatch' || needs.changes.outputs.python == 'true' || needs.changes.outputs.seed == 'true') &&
needs.get-all-test-matrices.outputs.python-sdk != ''
}}
strategy:
fail-fast: false # Let all tests run for debug, won't end up applying changes with a failure
max-parallel: 15 # Limit the number of runners for this job
matrix:
include: ${{ fromJSON(needs.get-all-test-matrices.outputs.python-sdk) }}
steps:
- name: Checkout repo
uses: actions/checkout@v4
with:
sparse-checkout: |
.github/actions/
- name: Update seed
uses: ./.github/actions/auto-update-seed
with:
generator-name: python-sdk
generator-path: generators/python
allow-unexpected-failures: true
fixtures-to-run: ${{ toJson(matrix.fixtures) }}
index: ${{ strategy.job-index }}
skip-scripts: ${{ needs.setup.outputs.skip-scripts }}
fastapi-seed-update:
runs-on: ubuntu-latest
timeout-minutes: 60
needs: [changes, setup, get-all-test-matrices]
if: >-
${{
always() && !cancelled() &&
(needs.setup.outputs.selected-language == 'all' || needs.setup.outputs.selected-language == 'python') &&
(github.event_name == 'workflow_dispatch' || needs.changes.outputs.python == 'true' || needs.changes.outputs.seed == 'true') &&
needs.get-all-test-matrices.outputs.fastapi != ''
}}
strategy:
fail-fast: false # Let all tests run for debug, won't end up applying changes with a failure
max-parallel: 15 # Limit the number of runners for this job
matrix:
include: ${{ fromJSON(needs.get-all-test-matrices.outputs.fastapi) }}
steps:
- name: Checkout repo
uses: actions/checkout@v4
with:
sparse-checkout: |
.github/actions/
- name: Update seed
uses: ./.github/actions/auto-update-seed
with:
generator-name: fastapi
generator-path: generators/python
allow-unexpected-failures: true
fixtures-to-run: ${{ toJson(matrix.fixtures) }}
index: ${{ strategy.job-index }}
skip-scripts: ${{ needs.setup.outputs.skip-scripts }}
openapi-seed-update:
runs-on: ubuntu-latest
timeout-minutes: 60
needs: [changes, setup, get-all-test-matrices]
if: >-
${{
always() && !cancelled() &&
(needs.setup.outputs.selected-language == 'all' || needs.setup.outputs.selected-language == 'openapi') &&
(github.event_name == 'workflow_dispatch' || needs.changes.outputs.openapi == 'true' || needs.changes.outputs.seed == 'true') &&
needs.get-all-test-matrices.outputs.openapi != ''
}}
strategy:
fail-fast: false # Let all tests run for debug, won't end up applying changes with a failure
max-parallel: 15 # Limit the number of runners for this job
matrix:
include: ${{ fromJSON(needs.get-all-test-matrices.outputs.openapi) }}
steps:
- name: Checkout repo
uses: actions/checkout@v4
with:
sparse-checkout: |
.github/actions/
- name: Update seed
uses: ./.github/actions/auto-update-seed
with:
generator-name: openapi
generator-path: generators/openapi
allow-unexpected-failures: true
fixtures-to-run: ${{ toJson(matrix.fixtures) }}
index: ${{ strategy.job-index }}
skip-scripts: ${{ needs.setup.outputs.skip-scripts }}
postman-seed-update:
runs-on: ubuntu-latest
timeout-minutes: 60
needs: [changes, setup, get-all-test-matrices]
if: >-
${{
always() && !cancelled() &&
(needs.setup.outputs.selected-language == 'all' || needs.setup.outputs.selected-language == 'postman') &&
(github.event_name == 'workflow_dispatch' || needs.changes.outputs.postman == 'true' || needs.changes.outputs.seed == 'true') &&
needs.get-all-test-matrices.outputs.postman != ''
}}
strategy:
fail-fast: false # Let all tests run for debug, won't end up applying changes with a failure
max-parallel: 15 # Limit the number of runners for this job
matrix:
include: ${{ fromJSON(needs.get-all-test-matrices.outputs.postman) }}
steps:
- name: Checkout repo
uses: actions/checkout@v4
with:
sparse-checkout: |
.github/actions/
- name: Update seed
uses: ./.github/actions/auto-update-seed
with:
generator-name: postman
generator-path: generators/postman
allow-unexpected-failures: true
fixtures-to-run: ${{ toJson(matrix.fixtures) }}
index: ${{ strategy.job-index }}
skip-scripts: ${{ needs.setup.outputs.skip-scripts }}
java-sdk-seed-update:
runs-on: ubuntu-latest
timeout-minutes: 60
needs: [changes, setup, get-all-test-matrices]
if: >-
${{
always() && !cancelled() &&
(needs.setup.outputs.selected-language == 'all' || needs.setup.outputs.selected-language == 'java') &&
(github.event_name == 'workflow_dispatch' || needs.changes.outputs.java == 'true' || needs.changes.outputs.seed == 'true') &&
needs.get-all-test-matrices.outputs.java-sdk != ''
}}
strategy:
fail-fast: false # Let all tests run for debug, won't end up applying changes with a failure
max-parallel: 15 # Limit the number of runners for this job
matrix:
include: ${{ fromJSON(needs.get-all-test-matrices.outputs.java-sdk) }}
steps:
- name: Checkout repo
uses: actions/checkout@v4
with:
sparse-checkout: |
.github/actions/
- name: Update seed
uses: ./.github/actions/auto-update-seed
with:
generator-name: java-sdk
generator-path: generators/java generators/java-v2
allow-unexpected-failures: true
fixtures-to-run: ${{ toJson(matrix.fixtures) }}
index: ${{ strategy.job-index }}
skip-scripts: ${{ needs.setup.outputs.skip-scripts }}
java-model-seed-update:
runs-on: ubuntu-latest
timeout-minutes: 60
needs: [changes, setup, get-all-test-matrices]
if: >-
${{
always() && !cancelled() &&
(needs.setup.outputs.selected-language == 'all' || needs.setup.outputs.selected-language == 'java') &&
(github.event_name == 'workflow_dispatch' || needs.changes.outputs.java == 'true' || needs.changes.outputs.seed == 'true') &&
needs.get-all-test-matrices.outputs.java-model != ''
}}
strategy:
fail-fast: false # Let all tests run for debug, won't end up applying changes with a failure
max-parallel: 15 # Limit the number of runners for this job
matrix:
include: ${{ fromJSON(needs.get-all-test-matrices.outputs.java-model) }}
steps:
- name: Checkout repo
uses: actions/checkout@v4
with:
sparse-checkout: |
.github/actions/
- name: Update seed
uses: ./.github/actions/auto-update-seed
with:
generator-name: java-model
generator-path: generators/java generators/java-v2
allow-unexpected-failures: true
fixtures-to-run: ${{ toJson(matrix.fixtures) }}
index: ${{ strategy.job-index }}
skip-scripts: ${{ needs.setup.outputs.skip-scripts }}
java-spring-seed-update:
runs-on: ubuntu-latest
timeout-minutes: 60
needs: [changes, setup, get-all-test-matrices]
if: >-
${{
always() && !cancelled() &&
(needs.setup.outputs.selected-language == 'all' || needs.setup.outputs.selected-language == 'java') &&
(github.event_name == 'workflow_dispatch' || needs.changes.outputs.java == 'true' || needs.changes.outputs.seed == 'true') &&
needs.get-all-test-matrices.outputs.java-spring != ''
}}
strategy:
fail-fast: false # Let all tests run for debug, won't end up applying changes with a failure
max-parallel: 15 # Limit the number of runners for this job
matrix:
include: ${{ fromJSON(needs.get-all-test-matrices.outputs.java-spring) }}
steps:
- name: Checkout repo
uses: actions/checkout@v4
with:
sparse-checkout: |
.github/actions/
- name: Update seed
uses: ./.github/actions/auto-update-seed
with:
generator-name: java-spring
generator-path: generators/java generators/java-v2
allow-unexpected-failures: true
fixtures-to-run: ${{ toJson(matrix.fixtures) }}
index: ${{ strategy.job-index }}
skip-scripts: ${{ needs.setup.outputs.skip-scripts }}
typescript-sdk-seed-update:
runs-on: ubuntu-latest
timeout-minutes: 60
needs: [changes, setup, get-all-test-matrices]
if: >-
${{
always() && !cancelled() &&
(needs.setup.outputs.selected-language == 'all' || needs.setup.outputs.selected-language == 'typescript') &&
(github.event_name == 'workflow_dispatch' || needs.changes.outputs.typescript == 'true' || needs.changes.outputs.seed == 'true') &&
needs.get-all-test-matrices.outputs.ts-sdk != ''
}}
strategy:
fail-fast: false # Let all tests run for debug, won't end up applying changes with a failure
max-parallel: 15 # Limit the number of runners for this job
matrix:
include: ${{ fromJSON(needs.get-all-test-matrices.outputs.ts-sdk) }}
steps:
- name: Checkout repo
uses: actions/checkout@v4
with:
sparse-checkout: |
.github/actions/
- name: Update seed
uses: ./.github/actions/auto-update-seed
with:
generator-name: ts-sdk
generator-path: generators/typescript generators/typescript-v2
allow-unexpected-failures: true
fixtures-to-run: ${{ toJson(matrix.fixtures) }}
index: ${{ strategy.job-index }}
skip-scripts: ${{ needs.setup.outputs.skip-scripts }}
typescript-express-seed-update:
runs-on: ubuntu-latest
timeout-minutes: 60
needs: [changes, setup, get-all-test-matrices]
if: >-
${{
always() && !cancelled() &&
(needs.setup.outputs.selected-language == 'all' || needs.setup.outputs.selected-language == 'typescript') &&
(github.event_name == 'workflow_dispatch' || needs.changes.outputs.typescript == 'true' || needs.changes.outputs.seed == 'true') &&
needs.get-all-test-matrices.outputs.ts-express != ''
}}
strategy:
fail-fast: false # Let all tests run for debug, won't end up applying changes with a failure
max-parallel: 15 # Limit the number of runners for this job
matrix:
include: ${{ fromJSON(needs.get-all-test-matrices.outputs.ts-express) }}
steps:
- name: Checkout repo
uses: actions/checkout@v4
with:
sparse-checkout: |
.github/actions/
- name: Update seed
uses: ./.github/actions/auto-update-seed
with:
generator-name: ts-express
generator-path: generators/typescript generators/typescript-v2
allow-unexpected-failures: true
fixtures-to-run: ${{ toJson(matrix.fixtures) }}
index: ${{ strategy.job-index }}
skip-scripts: ${{ needs.setup.outputs.skip-scripts }}
go-fiber-seed-update:
runs-on: ubuntu-latest
timeout-minutes: 60
needs: [changes, setup, get-all-test-matrices]
if: >-
${{
always() && !cancelled() &&
(needs.setup.outputs.selected-language == 'all' || needs.setup.outputs.selected-language == 'go') &&
(github.event_name == 'workflow_dispatch' || needs.changes.outputs.go == 'true' || needs.changes.outputs.seed == 'true') &&
needs.get-all-test-matrices.outputs.go-fiber != ''
}}
strategy:
fail-fast: false # Let all tests run for debug, won't end up applying changes with a failure
max-parallel: 15 # Limit the number of runners for this job
matrix:
include: ${{ fromJSON(needs.get-all-test-matrices.outputs.go-fiber) }}
steps:
- name: Checkout repo
uses: actions/checkout@v4
with:
sparse-checkout: |
.github/actions/
- name: Update seed
uses: ./.github/actions/auto-update-seed
with:
generator-name: go-fiber
generator-path: generators/go generators/go-v2
allow-unexpected-failures: true
fixtures-to-run: ${{ toJson(matrix.fixtures) }}
index: ${{ strategy.job-index }}
skip-scripts: ${{ needs.setup.outputs.skip-scripts }}
go-model-seed-update:
runs-on: ubuntu-latest
timeout-minutes: 60
needs: [changes, setup, get-all-test-matrices]
if: >-
${{
always() && !cancelled() &&
(needs.setup.outputs.selected-language == 'all' || needs.setup.outputs.selected-language == 'go') &&
(github.event_name == 'workflow_dispatch' || needs.changes.outputs.go == 'true' || needs.changes.outputs.seed == 'true') &&
needs.get-all-test-matrices.outputs.go-model != ''
}}
strategy:
fail-fast: false # Let all tests run for debug, won't end up applying changes with a failure
max-parallel: 15 # Limit the number of runners for this job
matrix:
include: ${{ fromJSON(needs.get-all-test-matrices.outputs.go-model) }}
steps:
- name: Checkout repo
uses: actions/checkout@v4
with:
sparse-checkout: |
.github/actions/
- name: Update seed
uses: ./.github/actions/auto-update-seed
with:
generator-name: go-model
generator-path: generators/go generators/go-v2
allow-unexpected-failures: true
fixtures-to-run: ${{ toJson(matrix.fixtures) }}
index: ${{ strategy.job-index }}
skip-scripts: ${{ needs.setup.outputs.skip-scripts }}
go-sdk-seed-update:
runs-on: ubuntu-latest
timeout-minutes: 60
needs: [changes, setup, get-all-test-matrices]
if: >-
${{
always() && !cancelled() &&
(needs.setup.outputs.selected-language == 'all' || needs.setup.outputs.selected-language == 'go') &&
(github.event_name == 'workflow_dispatch' || needs.changes.outputs.go == 'true' || needs.changes.outputs.seed == 'true') &&
needs.get-all-test-matrices.outputs.go-sdk != ''
}}
strategy:
fail-fast: false # Let all tests run for debug, won't end up applying changes with a failure
max-parallel: 15 # Limit the number of runners for this job
matrix:
include: ${{ fromJSON(needs.get-all-test-matrices.outputs.go-sdk) }}
steps:
- name: Checkout repo
uses: actions/checkout@v4
with:
sparse-checkout: |
.github/actions/
- name: Update seed
uses: ./.github/actions/auto-update-seed
with:
generator-name: go-sdk
generator-path: generators/go generators/go-v2
allow-unexpected-failures: true
fixtures-to-run: ${{ toJson(matrix.fixtures) }}
index: ${{ strategy.job-index }}
skip-scripts: ${{ needs.setup.outputs.skip-scripts }}
csharp-model-seed-update:
runs-on: ubuntu-latest
timeout-minutes: 60
needs: [changes, setup, get-all-test-matrices]
if: >-
${{
always() && !cancelled() &&
(needs.setup.outputs.selected-language == 'all' || needs.setup.outputs.selected-language == 'csharp') &&
(github.event_name == 'workflow_dispatch' || needs.changes.outputs.csharp == 'true' || needs.changes.outputs.seed == 'true') &&
needs.get-all-test-matrices.outputs.csharp-model != ''
}}
strategy:
fail-fast: false # Let all tests run for debug, won't end up applying changes with a failure
max-parallel: 15 # Limit the number of runners for this job
matrix:
include: ${{ fromJSON(needs.get-all-test-matrices.outputs.csharp-model) }}
steps:
- name: Checkout repo
uses: actions/checkout@v4
with:
sparse-checkout: |
.github/actions/
- name: Update seed
uses: ./.github/actions/auto-update-seed
with:
generator-name: csharp-model
generator-path: generators/csharp
allow-unexpected-failures: true
fixtures-to-run: ${{ toJson(matrix.fixtures) }}
index: ${{ strategy.job-index }}
skip-scripts: ${{ needs.setup.outputs.skip-scripts }}
csharp-sdk-seed-update:
runs-on: ubuntu-latest
timeout-minutes: 60
needs: [changes, setup, get-all-test-matrices]
if: >-
${{
always() && !cancelled() &&
(needs.setup.outputs.selected-language == 'all' || needs.setup.outputs.selected-language == 'csharp') &&
(github.event_name == 'workflow_dispatch' || needs.changes.outputs.csharp == 'true' || needs.changes.outputs.seed == 'true') &&
needs.get-all-test-matrices.outputs.csharp-sdk != ''
}}
strategy:
fail-fast: false # Let all tests run for debug, won't end up applying changes with a failure
max-parallel: 15 # Limit the number of runners for this job
matrix:
include: ${{ fromJSON(needs.get-all-test-matrices.outputs.csharp-sdk) }}
steps:
- name: Checkout repo
uses: actions/checkout@v4
with:
sparse-checkout: |
.github/actions/
- name: Update seed
uses: ./.github/actions/auto-update-seed
with:
generator-name: csharp-sdk
generator-path: generators/csharp
allow-unexpected-failures: true
fixtures-to-run: ${{ toJson(matrix.fixtures) }}
index: ${{ strategy.job-index }}
skip-scripts: ${{ needs.setup.outputs.skip-scripts }}
php-model-seed-update:
runs-on: ubuntu-latest
timeout-minutes: 60
needs: [changes, setup, get-all-test-matrices]
if: >-
${{
always() && !cancelled() &&
(needs.setup.outputs.selected-language == 'all' || needs.setup.outputs.selected-language == 'php') &&
(github.event_name == 'workflow_dispatch' || needs.changes.outputs.php == 'true' || needs.changes.outputs.seed == 'true') &&
needs.get-all-test-matrices.outputs.php-model != ''
}}
strategy:
fail-fast: false # Let all tests run for debug, won't end up applying changes with a failure
max-parallel: 15 # Limit the number of runners for this job
matrix:
include: ${{ fromJSON(needs.get-all-test-matrices.outputs.php-model) }}
steps:
- name: Checkout repo
uses: actions/checkout@v4
with:
sparse-checkout: |
.github/actions/
- name: Update seed
uses: ./.github/actions/auto-update-seed
with:
generator-name: php-model
generator-path: generators/php
allow-unexpected-failures: true
fixtures-to-run: ${{ toJson(matrix.fixtures) }}
index: ${{ strategy.job-index }}
skip-scripts: ${{ needs.setup.outputs.skip-scripts }}
php-sdk-seed-update:
runs-on: ubuntu-latest
timeout-minutes: 60
needs: [changes, setup, get-all-test-matrices]
if: >-
${{
always() && !cancelled() &&
(needs.setup.outputs.selected-language == 'all' || needs.setup.outputs.selected-language == 'php') &&
(github.event_name == 'workflow_dispatch' || needs.changes.outputs.php == 'true' || needs.changes.outputs.seed == 'true') &&
needs.get-all-test-matrices.outputs.php-sdk != ''
}}
strategy:
fail-fast: false # Let all tests run for debug, won't end up applying changes with a failure
max-parallel: 15 # Limit the number of runners for this job
matrix:
include: ${{ fromJSON(needs.get-all-test-matrices.outputs.php-sdk) }}
steps:
- name: Checkout repo
uses: actions/checkout@v4
with:
sparse-checkout: |
.github/actions/
- name: Update seed
uses: ./.github/actions/auto-update-seed
with:
generator-name: php-sdk
generator-path: generators/php
allow-unexpected-failures: true
fixtures-to-run: ${{ toJson(matrix.fixtures) }}
index: ${{ strategy.job-index }}
skip-scripts: ${{ needs.setup.outputs.skip-scripts }}
swift-sdk-seed-update:
runs-on: ubuntu-latest
timeout-minutes: 60
needs: [changes, setup, get-all-test-matrices]
if: >-
${{
always() && !cancelled() &&
(needs.setup.outputs.selected-language == 'all' || needs.setup.outputs.selected-language == 'swift') &&
(github.event_name == 'workflow_dispatch' || needs.changes.outputs.swift == 'true' || needs.changes.outputs.seed == 'true') &&
needs.get-all-test-matrices.outputs.swift-sdk != ''
}}
strategy:
fail-fast: false # Let all tests run for debug, won't end up applying changes with a failure
max-parallel: 15 # Limit the number of runners for this job
matrix:
include: ${{ fromJSON(needs.get-all-test-matrices.outputs.swift-sdk) }}
steps:
- name: Checkout repo
uses: actions/checkout@v4
with:
sparse-checkout: |
.github/actions/
- name: Update seed
uses: ./.github/actions/auto-update-seed
with:
generator-name: swift-sdk
generator-path: generators/swift
allow-unexpected-failures: true
fixtures-to-run: ${{ toJson(matrix.fixtures) }}
index: ${{ strategy.job-index }}
skip-scripts: ${{ needs.setup.outputs.skip-scripts }}
rust-model-seed-update:
runs-on: ubuntu-latest
timeout-minutes: 60
needs: [changes, setup, get-all-test-matrices]
if: >-
${{
always() && !cancelled() &&
(needs.setup.outputs.selected-language == 'all' || needs.setup.outputs.selected-language == 'rust') &&
(github.event_name == 'workflow_dispatch' || needs.changes.outputs.rust == 'true' || needs.changes.outputs.seed == 'true') &&
needs.get-all-test-matrices.outputs.rust-model != ''
}}
strategy:
fail-fast: false # Let all tests run for debug, won't end up applying changes with a failure
max-parallel: 15 # Limit the number of runners for this job
matrix:
include: ${{ fromJSON(needs.get-all-test-matrices.outputs.rust-model) }}
steps:
- name: Checkout repo
uses: actions/checkout@v4
with:
sparse-checkout: |
.github/actions/
- name: Update seed
uses: ./.github/actions/auto-update-seed
with:
generator-name: rust-model
generator-path: generators/rust
allow-unexpected-failures: true
fixtures-to-run: ${{ toJson(matrix.fixtures) }}
index: ${{ strategy.job-index }}
skip-scripts: ${{ needs.setup.outputs.skip-scripts }}
rust-sdk-seed-update:
runs-on: ubuntu-latest
timeout-minutes: 60
needs: [changes, setup, get-all-test-matrices]
if: >-
${{
always() && !cancelled() &&
(needs.setup.outputs.selected-language == 'all' || needs.setup.outputs.selected-language == 'rust') &&
(github.event_name == 'workflow_dispatch' || needs.changes.outputs.rust == 'true' || needs.changes.outputs.seed == 'true') &&
needs.get-all-test-matrices.outputs.rust-sdk != ''
}}
strategy:
fail-fast: false # Let all tests run for debug, won't end up applying changes with a failure
max-parallel: 15 # Limit the number of runners for this job
matrix:
include: ${{ fromJSON(needs.get-all-test-matrices.outputs.rust-sdk) }}
steps:
- name: Checkout repo
uses: actions/checkout@v4
with:
sparse-checkout: |
.github/actions/
- name: Update seed
uses: ./.github/actions/auto-update-seed
with:
generator-name: rust-sdk
generator-path: generators/rust
allow-unexpected-failures: true
fixtures-to-run: ${{ toJson(matrix.fixtures) }}
index: ${{ strategy.job-index }}
skip-scripts: ${{ needs.setup.outputs.skip-scripts }}
# Use always() to ensure this runs even if stages from needs are skipped.
# By default, block on failures. If commit-on-failure is true, continue even if some seed runs fail.
commit-seed-changes-by-push:
if: >-
${{
always() && !cancelled() && needs.setup.outputs.update-by-push == 'true' &&
(needs.setup.outputs.commit-on-failure == 'true' || (!contains(needs.*.result, 'failure') && !contains(needs.*.result, 'cancelled')))
}}
needs:
[
changes,
setup,
ruby-model-seed-update,
ruby-sdk-seed-update,
ruby-sdk-v2-seed-update,
pydantic-seed-update,
python-sdk-seed-update,
fastapi-seed-update,
openapi-seed-update,
postman-seed-update,
java-sdk-seed-update,
java-model-seed-update,
java-spring-seed-update,
typescript-sdk-seed-update,
typescript-express-seed-update,
go-fiber-seed-update,
go-model-seed-update,
go-sdk-seed-update,
csharp-model-seed-update,
csharp-sdk-seed-update,
php-model-seed-update,
php-sdk-seed-update,
swift-sdk-seed-update,
rust-model-seed-update,
rust-sdk-seed-update
]
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
# Get running branch name
- name: Extract Branch Name
id: extract-branch
shell: bash
run: |
echo "branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_OUTPUT
echo $branch
# Get action file specific to the running branch
- name: Checkout Action File
uses: actions/checkout@v4
with:
ref: ${{ steps.extract-branch.outputs.branch }}
sparse-checkout: |
.github/
# Match to all patch files, since we are committing all generator changes at once
# Checkout the branch directly to avoid detaching the head so we can commit back changes
- name: Apply Patches
id: apply-patches
uses: ./.github/actions/apply-update-seed-patches
with:
patch-pattern: seed-*.patch
checkout-ref: ${{ steps.extract-branch.outputs.branch }}
- name: Install
if: steps.apply-patches.outputs.has-patches == 'true'
uses: ./.github/actions/install
- name: Clean orphaned seed folders
if: steps.apply-patches.outputs.has-patches == 'true'
shell: bash
env:
FORCE_COLOR: "2"
run: |
pnpm seed:local clean
# Commit all applied patches back to branch (will be checked out in apply-patches step)
- name: Add and Commit Changes
id: commit-changes
uses: EndBug/add-and-commit@v9
if: ${{ steps.apply-patches.outputs.has-patches == 'true' }}
with:
add: "seed/*"
push: true
fetch: false
message: "Automated update of seed files"
# Verify that the branch is the default branch (running for PR to main)
# By default, block on failures. If commit-on-failure is true, continue even if some seed runs fail.
commit-seed-changes-by-pr:
if: >-
${{
always() && !cancelled() &&
github.ref == 'refs/heads/main' &&
needs.setup.outputs.update-by-pr == 'true' &&
(needs.setup.outputs.commit-on-failure == 'true' || (!contains(needs.*.result, 'failure') && !contains(needs.*.result, 'cancelled')))
}}
needs:
[
changes,
setup,
ruby-model-seed-update,
ruby-sdk-seed-update,
ruby-sdk-v2-seed-update,
pydantic-seed-update,
python-sdk-seed-update,
fastapi-seed-update,
openapi-seed-update,
postman-seed-update,
java-sdk-seed-update,
java-model-seed-update,
java-spring-seed-update,
typescript-sdk-seed-update,
typescript-express-seed-update,
go-fiber-seed-update,
go-model-seed-update,
go-sdk-seed-update,
csharp-model-seed-update,
csharp-sdk-seed-update,
php-model-seed-update,
php-sdk-seed-update,
swift-sdk-seed-update,
rust-model-seed-update,
rust-sdk-seed-update
]
runs-on: ubuntu-latest
timeout-minutes: 10
strategy:
matrix:
sdk-name:
[
ruby-model,
ruby-sdk,
ruby-sdk-v2,
pydantic,
python-sdk,
fastapi,
openapi,
postman,
java-sdk,
java-model,
java-spring,
ts-sdk,
ts-express,
go-fiber,
go-model,
go-sdk,
csharp-model,
csharp-sdk,
php-model,
php-sdk,
swift-sdk,
rust-model,
rust-sdk
]
include:
- language-name: ruby
sdk-name: ruby-model
- language-name: ruby
sdk-name: ruby-sdk
- language-name: ruby
sdk-name: ruby-sdk-v2
- language-name: python
sdk-name: pydantic
- language-name: python
sdk-name: python-sdk
- language-name: python
sdk-name: fastapi
- language-name: openapi
sdk-name: openapi
- language-name: postman
sdk-name: postman
- language-name: java
sdk-name: java-sdk
- language-name: java
sdk-name: java-model
- language-name: java
sdk-name: java-spring
- language-name: typescript
sdk-name: ts-sdk
- language-name: typescript
sdk-name: ts-express
- language-name: go
sdk-name: go-fiber
- language-name: go
sdk-name: go-model
- language-name: go
sdk-name: go-sdk
- language-name: csharp
sdk-name: csharp-model
- language-name: csharp
sdk-name: csharp-sdk
- language-name: php
sdk-name: php-model
- language-name: php
sdk-name: php-sdk
- language-name: swift
sdk-name: swift-sdk
- language-name: rust
sdk-name: rust-model
- language-name: rust
sdk-name: rust-sdk
steps:
- name: Checkout Action File
uses: actions/checkout@v4
with:
sparse-checkout: |
.github/
# Don't set checkout-ref, applying by PR so we can checkout detached
# Only match to patches with this matrix name, since we are PR'ing per generator
- name: Apply Patches
id: apply-patches
uses: ./.github/actions/apply-update-seed-patches
with:
patch-pattern: seed-${{ matrix.sdk-name }}-*.patch
- name: Install
if: steps.apply-patches.outputs.has-patches == 'true'
uses: ./.github/actions/install
- name: Clean orphaned seed folders for ${{ matrix.sdk-name }}
if: steps.apply-patches.outputs.has-patches == 'true'
shell: bash
env:
FORCE_COLOR: "2"
run: |
pnpm seed:local clean --generator ${{ matrix.sdk-name }}
# Create PR, approve and set to merge per generator
- name: Create Pull Request
if: steps.apply-patches.outputs.has-patches == 'true'
id: cpr
uses: peter-evans/create-pull-request@v5
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: "chore(${{ matrix.language-name }}): update ${{ matrix.sdk-name }} seed"
title: "chore(${{ matrix.language-name }}): update ${{ matrix.sdk-name }} seed"
branch: update-${{ matrix.sdk-name }}-seed
body: "Auto-generated PR, triggered by GitHub event: ${{ github.event_name }} from branch: ${{ github.ref_name }}.\nGitHub workflow run: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
delete-branch: true
add-paths: |
seed/**
labels: |
seed
language/${{ matrix.language-name }}
- name: Log PR Creation Failure
if: steps.cpr.outputs.pull-request-operation != 'created'
shell: bash
run: |
echo "PR was not created, likely due to no diff for the generated seed output"
- name: Log PR Creation Details
if: steps.cpr.outputs.pull-request-operation == 'created'
shell: bash
run: |
echo "PR Created: ${{ steps.cpr.outputs.pull-request-url }}"
- name: Enable Pull Request Automerge
if: steps.cpr.outputs.pull-request-operation == 'created'
uses: peter-evans/enable-pull-request-automerge@v3
with:
token: ${{ secrets.GITHUB_TOKEN }}
pull-request-number: ${{ steps.cpr.outputs.pull-request-number }}
merge-method: squash
- name: Approve PR
if: steps.cpr.outputs.pull-request-operation == 'created'
uses: ./.github/actions/auto-approve
with:
approver-gh-token: ${{ secrets.PR_BOT_GH_PAT }}
pull-request-number: ${{ steps.cpr.outputs.pull-request-number }}