diff --git a/.github/workflows/codegen.yaml b/.github/workflows/codegen.yaml index 1219980abca4..326956c3243e 100644 --- a/.github/workflows/codegen.yaml +++ b/.github/workflows/codegen.yaml @@ -28,7 +28,11 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} ENABLE_GIT_PUSH: true - id: detect-changes - run: cat /tmp/codegen-updates && echo APICodeGenUpdate=true >> "$GITHUB_OUTPUT" + run: | + # If we have a committed change, mark that we committed with a variable + if [[ $(git rev-list --count main..codegen) != "0" ]]; then + echo APICodeGenUpdate=true >> "$GITHUB_OUTPUT" + fi - name: Create Pull Request if: steps.detect-changes.outputs.APICodeGenUpdate == 'true' uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1