From ccd8e9666a786fc5b2eeaff1127ca142b5eb12e2 Mon Sep 17 00:00:00 2001 From: Ryan Albert Date: Wed, 24 Sep 2025 13:16:19 -0700 Subject: [PATCH] feat: try to fix usntaged files workflow bug --- .github/workflows/workflow-executor.yaml | 2 +- action.yml | 3 ++- internal/git/git.go | 8 ++++++++ 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/.github/workflows/workflow-executor.yaml b/.github/workflows/workflow-executor.yaml index cd589e5f..6284bdbb 100644 --- a/.github/workflows/workflow-executor.yaml +++ b/.github/workflows/workflow-executor.yaml @@ -234,7 +234,7 @@ jobs: - id: run-workflow name: Run Generation Workflow if: ${{ steps.check-label.outputs.short_circuit_label_trigger != 'true' }} - uses: speakeasy-api/sdk-generation-action@v15 + uses: speakeasy-api/sdk-generation-action@v15.51 with: speakeasy_version: ${{ inputs.speakeasy_version }} github_access_token: ${{ secrets.github_access_token }} diff --git a/action.yml b/action.yml index cdab757c..50f180f6 100644 --- a/action.yml +++ b/action.yml @@ -209,13 +209,14 @@ outputs: description: "The release tag used for standalone ts mcp binaries" runs: using: "docker" - image: "docker://ghcr.io/speakeasy-api/sdk-generation-action:v15" + image: "docker://ghcr.io/speakeasy-api/sdk-generation-action:v15.51" env: SPEAKEASY_API_KEY: ${{ inputs.speakeasy_api_key }} SPEAKEASY_SERVER_URL: ${{ inputs.speakeasy_server_url }} OPENAI_API_KEY: ${{ inputs.openai_api_key }} OPENAPI_DOC_AUTH_TOKEN: ${{ inputs.openapi_doc_auth_token }} PR_CREATION_PAT: ${{ inputs.pr_creation_pat }} + INPUT_DEBUG: "true" args: - ${{ inputs.speakeasy_version }} - ${{ inputs.github_access_token }} diff --git a/internal/git/git.go b/internal/git/git.go index 418e6040..f4eb690e 100644 --- a/internal/git/git.go +++ b/internal/git/git.go @@ -744,6 +744,14 @@ func (g *Git) createAndPushTree(ref *github.Reference, sourceFiles git.Status) ( } func (g *Git) Add(arg string) error { + // Ensure we remove deleted files from index first + cleanup := exec.Command("bash", "-c", "git ls-files --deleted -z | xargs -0 git rm --cached --ignore-unmatch") + cleanup.Dir = filepath.Join(environment.GetWorkspace(), "repo", environment.GetWorkingDirectory()) + cleanup.Env = os.Environ() + if out, err := cleanup.CombinedOutput(); err != nil { + logging.Debug("Cleanup of deleted files failed (non-fatal): %s", string(out)) + } + // We execute this manually because go-git doesn't properly support gitignore cmd := exec.Command("git", "add", "--renormalize", arg) cmd.Dir = filepath.Join(environment.GetWorkspace(), "repo", environment.GetWorkingDirectory())