From 16c3214862eba3ff9223d8f0e5f9a06f6489a6f5 Mon Sep 17 00:00:00 2001 From: Gara Dorta Date: Wed, 6 May 2026 12:28:43 +0100 Subject: [PATCH 1/3] Add update docs ci --- .github/workflows/update-generated-docs.yml | 41 +++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 .github/workflows/update-generated-docs.yml diff --git a/.github/workflows/update-generated-docs.yml b/.github/workflows/update-generated-docs.yml new file mode 100644 index 0000000..8fa75f7 --- /dev/null +++ b/.github/workflows/update-generated-docs.yml @@ -0,0 +1,41 @@ +name: Update Generated Docs + +on: + push: + branches: + - master + +permissions: + contents: write + pull-requests: write + +jobs: + update-docs: + runs-on: ubuntu-24.04 + steps: + - name: Checkout + uses: actions/checkout@v6 + + - name: Set up Go + uses: actions/setup-go@v6 + with: + go-version-file: src/go.mod + cache-dependency-path: src/go.sum + + - name: Regenerate docs + working-directory: src + run: go run github.com/swaggo/swag/cmd/swag@v1.16.6 init --requiredByDefault + + - name: Create pull request for regenerated docs + uses: peter-evans/create-pull-request@v8 + with: + branch: automation/update-generated-docs + delete-branch: true + commit-message: "chore: regenerate swagger docs" + title: "chore: regenerate swagger docs" + body: | + Update Swagger docs to match the latest changes in the main branch. + add-paths: | + src/docs/docs.go + src/docs/swagger.json + src/docs/swagger.yaml From 44ac16d49cae38f7a086ced29e1f3f851161c38c Mon Sep 17 00:00:00 2001 From: Gara Dorta <1507774+Gara-Dorta@users.noreply.github.com> Date: Fri, 15 May 2026 19:47:51 +0200 Subject: [PATCH 2/3] check docs before a release --- .github/workflows/check-docs.yml | 28 +++++++++++++ .github/workflows/release-dev-version.yml | 4 ++ .../workflows/release-productive-version.yml | 4 ++ .github/workflows/update-generated-docs.yml | 41 ------------------- 4 files changed, 36 insertions(+), 41 deletions(-) create mode 100644 .github/workflows/check-docs.yml delete mode 100644 .github/workflows/update-generated-docs.yml diff --git a/.github/workflows/check-docs.yml b/.github/workflows/check-docs.yml new file mode 100644 index 0000000..0d372af --- /dev/null +++ b/.github/workflows/check-docs.yml @@ -0,0 +1,28 @@ +name: Check Generated Docs + +on: + workflow_call: + +permissions: + contents: read + +jobs: + check-docs: + runs-on: ubuntu-24.04 + steps: + - name: Checkout + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + + - name: Set up Go + uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.0.0 + with: + go-version-file: src/go.mod + cache-dependency-path: src/go.sum + + - name: Regenerate docs + working-directory: src + run: go run github.com/swaggo/swag/cmd/swag@v1.16.6 init --requiredByDefault + + - name: Fail if docs are out of date + run: | + git diff --exit-code -- src/docs/docs.go src/docs/swagger.json src/docs/swagger.yaml diff --git a/.github/workflows/release-dev-version.yml b/.github/workflows/release-dev-version.yml index 683825e..a1bceac 100644 --- a/.github/workflows/release-dev-version.yml +++ b/.github/workflows/release-dev-version.yml @@ -11,8 +11,12 @@ permissions: {} jobs: + check-docs: + uses: ./.github/workflows/check-docs.yml + setup: runs-on: ubuntu-24.04 + needs: check-docs steps: - name: Set up QEMU uses: docker/setup-qemu-action@ce360397dd3f832beb865e1373c09c0e9f86d70a # v4.0.0 diff --git a/.github/workflows/release-productive-version.yml b/.github/workflows/release-productive-version.yml index c0b5f9a..a38e4a7 100644 --- a/.github/workflows/release-productive-version.yml +++ b/.github/workflows/release-productive-version.yml @@ -11,8 +11,12 @@ permissions: {} jobs: + check-docs: + uses: ./.github/workflows/check-docs.yml + setup: runs-on: ubuntu-24.04 + needs: check-docs steps: - name: Set up QEMU uses: docker/setup-qemu-action@ce360397dd3f832beb865e1373c09c0e9f86d70a # v4.0.0 diff --git a/.github/workflows/update-generated-docs.yml b/.github/workflows/update-generated-docs.yml deleted file mode 100644 index 8fa75f7..0000000 --- a/.github/workflows/update-generated-docs.yml +++ /dev/null @@ -1,41 +0,0 @@ -name: Update Generated Docs - -on: - push: - branches: - - master - -permissions: - contents: write - pull-requests: write - -jobs: - update-docs: - runs-on: ubuntu-24.04 - steps: - - name: Checkout - uses: actions/checkout@v6 - - - name: Set up Go - uses: actions/setup-go@v6 - with: - go-version-file: src/go.mod - cache-dependency-path: src/go.sum - - - name: Regenerate docs - working-directory: src - run: go run github.com/swaggo/swag/cmd/swag@v1.16.6 init --requiredByDefault - - - name: Create pull request for regenerated docs - uses: peter-evans/create-pull-request@v8 - with: - branch: automation/update-generated-docs - delete-branch: true - commit-message: "chore: regenerate swagger docs" - title: "chore: regenerate swagger docs" - body: | - Update Swagger docs to match the latest changes in the main branch. - add-paths: | - src/docs/docs.go - src/docs/swagger.json - src/docs/swagger.yaml From 0aaab36e5f6759c7a28ba4b2470efac4a8e6778d Mon Sep 17 00:00:00 2001 From: Gara Dorta <1507774+Gara-Dorta@users.noreply.github.com> Date: Fri, 15 May 2026 19:50:35 +0200 Subject: [PATCH 3/3] Enable read of repo --- .github/workflows/release-dev-version.yml | 4 ++-- .github/workflows/release-productive-version.yml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/release-dev-version.yml b/.github/workflows/release-dev-version.yml index a1bceac..8581b3d 100644 --- a/.github/workflows/release-dev-version.yml +++ b/.github/workflows/release-dev-version.yml @@ -7,8 +7,8 @@ on: description: 'Version' required: true -permissions: {} - +permissions: + contents: read jobs: check-docs: diff --git a/.github/workflows/release-productive-version.yml b/.github/workflows/release-productive-version.yml index a38e4a7..357818c 100644 --- a/.github/workflows/release-productive-version.yml +++ b/.github/workflows/release-productive-version.yml @@ -7,8 +7,8 @@ on: description: 'Version' required: true -permissions: {} - +permissions: + contents: read jobs: check-docs: