From 769ae04be7cc88d71d8afa2e5d6d52a9e72d1971 Mon Sep 17 00:00:00 2001 From: Andrew Wylde Date: Tue, 3 Oct 2023 15:02:33 -0500 Subject: [PATCH] chore: update CI to prevent extra commits --- .github/workflows/generate-sdk.yaml | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/.github/workflows/generate-sdk.yaml b/.github/workflows/generate-sdk.yaml index b3cbf75..f8ecbf2 100644 --- a/.github/workflows/generate-sdk.yaml +++ b/.github/workflows/generate-sdk.yaml @@ -7,9 +7,23 @@ on: permissions: contents: write jobs: + get-changed-files: + name: Get Changed Files + runs-on: ubuntu-latest + outputs: + oas-modified: ${{ steps.oas-modified.outputs.any_modified }} + steps: + - name: Check if `openapi.yaml` has changed + uses: tj-actions/changed-files@v35.7.1 + id: oas-modified + with: + files: | + openapi.yaml generate-js: name: Generate JavaScript SDK runs-on: ubuntu-latest + needs: [get-changed-files] + if: needs.get-changed-files.outputs.oas-modified == 'true' steps: - uses: actions/checkout@v3 @@ -34,5 +48,5 @@ jobs: git config --global user.name "team-devx" gh pr checkout ${{ github.event.pull_request.number }} git add src/ - git commit --allow-empty -m "Update SDK based on openapi.yaml changes" + git commit -m "chore: build SDK from openapi.yaml changes" git push