From af1aa90145b4eafc2298a073d93b429b1c641901 Mon Sep 17 00:00:00 2001 From: PatrickMenoti <82882574+PatrickMenoti@users.noreply.github.com> Date: Thu, 14 Aug 2025 10:01:09 -0300 Subject: [PATCH] chore: update workflow --- .github/workflows/generate.yml | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/.github/workflows/generate.yml b/.github/workflows/generate.yml index fe9a1ac..e0d226f 100644 --- a/.github/workflows/generate.yml +++ b/.github/workflows/generate.yml @@ -67,17 +67,15 @@ jobs: #get all .yaml files which were added/modified - name: Get changed files id: changed-files - uses: tj-actions/changed-files@v35 - with: - files: | - **/*.yaml - ignore: | - **/*spectral*.yaml + run: | + YAML_FILES=$(git diff --name-only origin/main HEAD | grep -E '\.yaml$' | grep -v '/api/openapi.yaml' | grep -v "publish-config.yaml" | grep -v "openapi.yaml" || echo "") + echo "YAML_FILES=$YAML_FILES" >> $GITHUB_ENV + shell: bash - name: Run openapi-generator for changed files run: | - for file in ${{ steps.changed-files.outputs.all_changed_files }}; do - removed=$(echo ${file} | cut -d. -f1); + for file in ${{ env.YAML_FILES }}; do + removed=$(echo ${file} | cut -d. -f1 | sed 's|^./||'); npx @openapitools/openapi-generator-cli generate -i $file -g ${{ matrix.types }} -o ./${{ matrix.types }}/${removed} --package-name ${removed};\ echo 'go.mod' >> ./${{ matrix.types }}/${removed}/.gitignore echo 'go.sum' >> ./${{ matrix.types }}/${removed}/.gitignore