From 288fa8450095c4d5174098fecf840fe7962950c3 Mon Sep 17 00:00:00 2001 From: Gil Desmarais Date: Fri, 1 May 2026 15:11:16 +0200 Subject: [PATCH 1/2] ci: harden openapi auto-regeneration and streamline config --- .github/release-please-config.json | 6 +----- .github/workflows/ci.yml | 17 +++++++++++++---- 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/.github/release-please-config.json b/.github/release-please-config.json index 47131b1c..f4bc995c 100644 --- a/.github/release-please-config.json +++ b/.github/release-please-config.json @@ -11,11 +11,7 @@ "path": "frontend/package.json", "jsonpath": "$.version" }, - "public/openapi.yaml", - "frontend/src/api/generated/client.gen.ts", - "frontend/src/api/generated/sdk.gen.ts", - "frontend/src/api/generated/types.gen.ts", - "frontend/src/api/generated/index.ts" + "public/openapi.yaml" ] } } diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 18c8e7e3..d0667c22 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -47,10 +47,14 @@ jobs: openapi: runs-on: ubuntu-latest + permissions: + contents: write steps: - uses: actions/checkout@v6 with: token: ${{ secrets.RELEASE_PLEASE_TOKEN || github.token }} + ref: ${{ github.head_ref }} + fetch-depth: 0 - uses: ruby/setup-ruby@v1 with: @@ -87,11 +91,16 @@ jobs: make openapi-client git add public/openapi.yaml frontend/src/api/generated/ - git commit -m "chore: regenerate openapi spec and client for version bump" - git push - echo "## OpenAPI artifacts regenerated" >> "$GITHUB_STEP_SUMMARY" - echo "Version bump detected; OpenAPI spec and frontend client have been regenerated and committed." >> "$GITHUB_STEP_SUMMARY" + if git diff --staged --quiet; then + echo "No changes to commit" + else + git commit -m "chore: regenerate openapi spec and client for version bump" + git push origin ${{ github.head_ref }} + + echo "## OpenAPI artifacts regenerated" >> "$GITHUB_STEP_SUMMARY" + echo "Version bump detected; OpenAPI spec and frontend client have been regenerated and committed." >> "$GITHUB_STEP_SUMMARY" + fi - name: Lint OpenAPI contract run: make openapi-lint From 26c7b15327f7ee4b4a3644d128ec64a725f64315 Mon Sep 17 00:00:00 2001 From: Gil Desmarais Date: Fri, 1 May 2026 15:16:28 +0200 Subject: [PATCH 2/2] ci: fix checkout ref fallback in openapi job --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d0667c22..186e25cf 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -53,7 +53,7 @@ jobs: - uses: actions/checkout@v6 with: token: ${{ secrets.RELEASE_PLEASE_TOKEN || github.token }} - ref: ${{ github.head_ref }} + ref: ${{ (github.event_name == 'pull_request' && startsWith(github.head_ref, 'release-please--')) && github.head_ref || github.sha }} fetch-depth: 0 - uses: ruby/setup-ruby@v1