From 25b1f9e772bfd837acce4f01f63ec91f05bd3228 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20Lars=C3=A9n?= Date: Thu, 18 Jun 2026 08:20:57 +0200 Subject: [PATCH 01/25] Add test workflow --- .github/workflows/update-generated-docs.yml | 33 +++++++++++++++++++++ 1 file changed, 33 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..5b04649 --- /dev/null +++ b/.github/workflows/update-generated-docs.yml @@ -0,0 +1,33 @@ +name: "Update Generated Docs" + +on: + push: + branches: [GB-1405/automate-cli-docs-update] + +permissions: {} + +jobs: + test_create_pr: + runs-on: ubuntu-latest + permissions: + contents: write + pull-requests: write + steps: + - uses: actions/checkout@v4 + + - run: | + git config user.name "github-actions[bot]" + git config user.email "41898282+github-actions[bot]@users.noreply.github.com" + + branch="test-generated-docs-${{ github.run_id }}" + git checkout -b "$branch" + git commit --allow-empty -m "Test" + git push origin "$branch" + + gh pr create \ + --title "Test PR" \ + --body "Created by CI" \ + --base main \ + --head "$branch" + env: + GH_TOKEN: ${{ github.token }} From d4baa2d13151db05efd6d776bf0f5a4f38874497 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20Lars=C3=A9n?= Date: Thu, 18 Jun 2026 09:38:50 +0200 Subject: [PATCH 02/25] Use PAT for API access --- .github/workflows/update-generated-docs.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/update-generated-docs.yml b/.github/workflows/update-generated-docs.yml index 5b04649..db39800 100644 --- a/.github/workflows/update-generated-docs.yml +++ b/.github/workflows/update-generated-docs.yml @@ -9,9 +9,9 @@ permissions: {} jobs: test_create_pr: runs-on: ubuntu-latest + environment: Docs generation permissions: contents: write - pull-requests: write steps: - uses: actions/checkout@v4 @@ -24,10 +24,13 @@ jobs: git commit --allow-empty -m "Test" git push origin "$branch" + echo "branch=$branch" >> "$GITHUB_ENV" + + - run: | gh pr create \ --title "Test PR" \ --body "Created by CI" \ --base main \ --head "$branch" env: - GH_TOKEN: ${{ github.token }} + GH_TOKEN: ${{ secrets.GH_CREATE_PR_PAT }} From 1c0c18d0d8ca9e2f92b2f0c335dd5bab3ff026f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20Lars=C3=A9n?= Date: Thu, 18 Jun 2026 09:45:24 +0200 Subject: [PATCH 03/25] Try actually generating the docs --- .github/workflows/update-generated-docs.yml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/update-generated-docs.yml b/.github/workflows/update-generated-docs.yml index db39800..626ff2b 100644 --- a/.github/workflows/update-generated-docs.yml +++ b/.github/workflows/update-generated-docs.yml @@ -14,6 +14,11 @@ jobs: contents: write steps: - uses: actions/checkout@v4 + with: + ref: master + + - run: git clone --depth=1 https://github.com/gitbutlerapp/gitbutler ../gitbutler + - run: ./scripts/update-manpages.sh - run: | git config user.name "github-actions[bot]" @@ -21,14 +26,15 @@ jobs: branch="test-generated-docs-${{ github.run_id }}" git checkout -b "$branch" - git commit --allow-empty -m "Test" + git add . + git commit -m "Update CLI docs" git push origin "$branch" echo "branch=$branch" >> "$GITHUB_ENV" - run: | gh pr create \ - --title "Test PR" \ + --title "Update generated CLI documentation" \ --body "Created by CI" \ --base main \ --head "$branch" From 41a24d4c0c4c171bf652b62c43a44cf661b6b13f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20Lars=C3=A9n?= Date: Thu, 18 Jun 2026 09:52:31 +0200 Subject: [PATCH 04/25] Set correct reference --- .github/workflows/update-generated-docs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/update-generated-docs.yml b/.github/workflows/update-generated-docs.yml index 626ff2b..dafd363 100644 --- a/.github/workflows/update-generated-docs.yml +++ b/.github/workflows/update-generated-docs.yml @@ -15,7 +15,7 @@ jobs: steps: - uses: actions/checkout@v4 with: - ref: master + ref: main - run: git clone --depth=1 https://github.com/gitbutlerapp/gitbutler ../gitbutler - run: ./scripts/update-manpages.sh From 910d90017851da057dc76e5fe710c2dd8166a850 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20Lars=C3=A9n?= Date: Thu, 18 Jun 2026 10:00:42 +0200 Subject: [PATCH 05/25] Add missing system dependency --- .github/workflows/update-generated-docs.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/update-generated-docs.yml b/.github/workflows/update-generated-docs.yml index dafd363..891397e 100644 --- a/.github/workflows/update-generated-docs.yml +++ b/.github/workflows/update-generated-docs.yml @@ -17,6 +17,10 @@ jobs: with: ref: main + - run: | + sudo apt-get update + sudo apt-get install -y libdbus-1-dev + - run: git clone --depth=1 https://github.com/gitbutlerapp/gitbutler ../gitbutler - run: ./scripts/update-manpages.sh From 12c94cb4cb55e2072e77579ad1b09d6f4a5dfbe2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20Lars=C3=A9n?= Date: Thu, 18 Jun 2026 10:02:20 +0200 Subject: [PATCH 06/25] Add another missing system package --- .github/workflows/update-generated-docs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/update-generated-docs.yml b/.github/workflows/update-generated-docs.yml index 891397e..87d6395 100644 --- a/.github/workflows/update-generated-docs.yml +++ b/.github/workflows/update-generated-docs.yml @@ -19,7 +19,7 @@ jobs: - run: | sudo apt-get update - sudo apt-get install -y libdbus-1-dev + sudo apt-get install -y libdbus-1-dev pkg-config - run: git clone --depth=1 https://github.com/gitbutlerapp/gitbutler ../gitbutler - run: ./scripts/update-manpages.sh From 70843f6416e79e5dd3b30b4661360c6d267f5af3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20Lars=C3=A9n?= Date: Thu, 18 Jun 2026 10:13:28 +0200 Subject: [PATCH 07/25] Update workflow to only generate docs if necessary --- .github/workflows/update-generated-docs.yml | 31 +++++++++++++++++---- 1 file changed, 25 insertions(+), 6 deletions(-) diff --git a/.github/workflows/update-generated-docs.yml b/.github/workflows/update-generated-docs.yml index 87d6395..d03d496 100644 --- a/.github/workflows/update-generated-docs.yml +++ b/.github/workflows/update-generated-docs.yml @@ -12,19 +12,37 @@ jobs: environment: Docs generation permissions: contents: write + env: + CURRENT_DOCS_VERSION: release/0.20.0 steps: - uses: actions/checkout@v4 with: ref: main - run: | - sudo apt-get update - sudo apt-get install -y libdbus-1-dev pkg-config + git clone https://github.com/gitbutlerapp/gitbutler ../gitbutler - - run: git clone --depth=1 https://github.com/gitbutlerapp/gitbutler ../gitbutler - - run: ./scripts/update-manpages.sh + - id: versions + run: | + LATEST_RELEASE=$(git -C ../gitbutler tag --sort=-version:refname | grep '^release/' | head -n 1) + + echo "latest_release=$LATEST_RELEASE" >> "$GITHUB_OUTPUT" + + if [ "$LATEST_RELEASE" != "$CURRENT_DOCS_VERSION" ]; then + echo "should_update=true" >> "$GITHUB_OUTPUT" + else + echo "should_update=false" >> "$GITHUB_OUTPUT" + fi + + - if: steps.versions.outputs.should_update == 'true' + run: | + sudo apt-get update + sudo apt-get install -y libdbus-1-dev libglib2.0-dev pkg-config + + ./scripts/update-manpages.sh + + sed -i "s|CURRENT_DOCS_VERSION: .*|CURRENT_DOCS_VERSION: ${{ steps.versions.outputs.latest_release }}|" .github/workflows/update-generated-docs.yml - - run: | git config user.name "github-actions[bot]" git config user.email "41898282+github-actions[bot]@users.noreply.github.com" @@ -36,7 +54,8 @@ jobs: echo "branch=$branch" >> "$GITHUB_ENV" - - run: | + - if: steps.versions.outputs.should_update == 'true' + run: | gh pr create \ --title "Update generated CLI documentation" \ --body "Created by CI" \ From fd46cd89c7cf43f2b603ce2eb249145e7dc64c7a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20Lars=C3=A9n?= Date: Thu, 18 Jun 2026 10:34:44 +0200 Subject: [PATCH 08/25] Tweak generation to not compile too much --- .github/workflows/update-generated-docs.yml | 10 +++++++--- scripts/update-manpages.sh | 2 +- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/.github/workflows/update-generated-docs.yml b/.github/workflows/update-generated-docs.yml index d03d496..9ff3f63 100644 --- a/.github/workflows/update-generated-docs.yml +++ b/.github/workflows/update-generated-docs.yml @@ -22,7 +22,8 @@ jobs: - run: | git clone https://github.com/gitbutlerapp/gitbutler ../gitbutler - - id: versions + - name: Compare versions + id: versions run: | LATEST_RELEASE=$(git -C ../gitbutler tag --sort=-version:refname | grep '^release/' | head -n 1) @@ -34,11 +35,13 @@ jobs: echo "should_update=false" >> "$GITHUB_OUTPUT" fi - - if: steps.versions.outputs.should_update == 'true' + - name: Update generated docs + if: steps.versions.outputs.should_update == 'true' run: | sudo apt-get update sudo apt-get install -y libdbus-1-dev libglib2.0-dev pkg-config + git -C ../gitbutler checkout "${{ steps.versions.outputs.latest_release }}" ./scripts/update-manpages.sh sed -i "s|CURRENT_DOCS_VERSION: .*|CURRENT_DOCS_VERSION: ${{ steps.versions.outputs.latest_release }}|" .github/workflows/update-generated-docs.yml @@ -54,7 +57,8 @@ jobs: echo "branch=$branch" >> "$GITHUB_ENV" - - if: steps.versions.outputs.should_update == 'true' + - name: Create pull request + if: steps.versions.outputs.should_update == 'true' run: | gh pr create \ --title "Update generated CLI documentation" \ diff --git a/scripts/update-manpages.sh b/scripts/update-manpages.sh index 7921d58..50ea34c 100755 --- a/scripts/update-manpages.sh +++ b/scripts/update-manpages.sh @@ -38,7 +38,7 @@ rm -f cli-docs/* # Regenerate documentation using cargo echo "Regenerating CLI documentation with cargo..." -cargo run --bin but-clap --features raw-clap-docs +cargo run -p but-clap --bin but-clap --features raw-clap-docs echo "Documentation files regenerated successfully!" echo From a41c61b9d24285183b7ffe052a5ea97e317d7ab0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20Lars=C3=A9n?= Date: Thu, 18 Jun 2026 10:43:08 +0200 Subject: [PATCH 09/25] Temporarily comment out feature --- scripts/update-manpages.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/update-manpages.sh b/scripts/update-manpages.sh index 50ea34c..2a70366 100755 --- a/scripts/update-manpages.sh +++ b/scripts/update-manpages.sh @@ -38,7 +38,7 @@ rm -f cli-docs/* # Regenerate documentation using cargo echo "Regenerating CLI documentation with cargo..." -cargo run -p but-clap --bin but-clap --features raw-clap-docs +cargo run -p but-clap --bin but-clap #--features raw-clap-docs echo "Documentation files regenerated successfully!" echo From 9be8d81ef05396772fa811bd7123c6c841ae7f74 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20Lars=C3=A9n?= Date: Thu, 18 Jun 2026 10:48:14 +0200 Subject: [PATCH 10/25] remove feature --- scripts/update-manpages.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/update-manpages.sh b/scripts/update-manpages.sh index 2a70366..a12c06f 100755 --- a/scripts/update-manpages.sh +++ b/scripts/update-manpages.sh @@ -38,7 +38,7 @@ rm -f cli-docs/* # Regenerate documentation using cargo echo "Regenerating CLI documentation with cargo..." -cargo run -p but-clap --bin but-clap #--features raw-clap-docs +cargo run -p but-clap --bin but-clap echo "Documentation files regenerated successfully!" echo From 3cfb671e6af5bffcde2741a67ed212dcb11f88f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20Lars=C3=A9n?= Date: Thu, 18 Jun 2026 10:51:40 +0200 Subject: [PATCH 11/25] temporarily comment out ref --- .github/workflows/update-generated-docs.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/update-generated-docs.yml b/.github/workflows/update-generated-docs.yml index 9ff3f63..e6497aa 100644 --- a/.github/workflows/update-generated-docs.yml +++ b/.github/workflows/update-generated-docs.yml @@ -16,8 +16,8 @@ jobs: CURRENT_DOCS_VERSION: release/0.20.0 steps: - uses: actions/checkout@v4 - with: - ref: main +# with: +# ref: main - run: | git clone https://github.com/gitbutlerapp/gitbutler ../gitbutler From e6018a5c002584f8913c3dd5eb446a309312de5e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20Lars=C3=A9n?= Date: Thu, 18 Jun 2026 10:54:58 +0200 Subject: [PATCH 12/25] try with nightly instead --- .github/workflows/update-generated-docs.yml | 8 ++++---- scripts/update-manpages.sh | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/update-generated-docs.yml b/.github/workflows/update-generated-docs.yml index e6497aa..62ff4ab 100644 --- a/.github/workflows/update-generated-docs.yml +++ b/.github/workflows/update-generated-docs.yml @@ -13,11 +13,11 @@ jobs: permissions: contents: write env: - CURRENT_DOCS_VERSION: release/0.20.0 + CURRENT_DOCS_VERSION: nightly/0.5.2077 steps: - uses: actions/checkout@v4 -# with: -# ref: main + with: + ref: main - run: | git clone https://github.com/gitbutlerapp/gitbutler ../gitbutler @@ -25,7 +25,7 @@ jobs: - name: Compare versions id: versions run: | - LATEST_RELEASE=$(git -C ../gitbutler tag --sort=-version:refname | grep '^release/' | head -n 1) + LATEST_RELEASE=$(git -C ../gitbutler tag --sort=-version:refname | grep '^nightly/' | head -n 1) echo "latest_release=$LATEST_RELEASE" >> "$GITHUB_OUTPUT" diff --git a/scripts/update-manpages.sh b/scripts/update-manpages.sh index a12c06f..50ea34c 100755 --- a/scripts/update-manpages.sh +++ b/scripts/update-manpages.sh @@ -38,7 +38,7 @@ rm -f cli-docs/* # Regenerate documentation using cargo echo "Regenerating CLI documentation with cargo..." -cargo run -p but-clap --bin but-clap +cargo run -p but-clap --bin but-clap --features raw-clap-docs echo "Documentation files regenerated successfully!" echo From f69e6307a2ee360fe8c1415bb21e5efb4b1ffc2c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20Lars=C3=A9n?= Date: Thu, 18 Jun 2026 11:02:47 +0200 Subject: [PATCH 13/25] Put latest docs version outside workflow --- .github/workflows/current_docs_version.txt | 1 + .github/workflows/update-generated-docs.yml | 17 +++++++++-------- 2 files changed, 10 insertions(+), 8 deletions(-) create mode 100644 .github/workflows/current_docs_version.txt diff --git a/.github/workflows/current_docs_version.txt b/.github/workflows/current_docs_version.txt new file mode 100644 index 0000000..9acc19d --- /dev/null +++ b/.github/workflows/current_docs_version.txt @@ -0,0 +1 @@ +nightly/0.5.2078 diff --git a/.github/workflows/update-generated-docs.yml b/.github/workflows/update-generated-docs.yml index 62ff4ab..b03bb46 100644 --- a/.github/workflows/update-generated-docs.yml +++ b/.github/workflows/update-generated-docs.yml @@ -12,8 +12,6 @@ jobs: environment: Docs generation permissions: contents: write - env: - CURRENT_DOCS_VERSION: nightly/0.5.2077 steps: - uses: actions/checkout@v4 with: @@ -25,11 +23,12 @@ jobs: - name: Compare versions id: versions run: | - LATEST_RELEASE=$(git -C ../gitbutler tag --sort=-version:refname | grep '^nightly/' | head -n 1) + CURRENT_DOCS_VERSION=$(cat .github/workflows/current_docs_version.txt) + LATEST_VERSION=$(git -C ../gitbutler tag --sort=-version:refname | grep '^nightly/' | head -n 1) - echo "latest_release=$LATEST_RELEASE" >> "$GITHUB_OUTPUT" + echo "latest_version=$LATEST_VERSION" >> "$GITHUB_OUTPUT" - if [ "$LATEST_RELEASE" != "$CURRENT_DOCS_VERSION" ]; then + if [ "$LATEST_VERSION" != "$CURRENT_DOCS_VERSION" ]; then echo "should_update=true" >> "$GITHUB_OUTPUT" else echo "should_update=false" >> "$GITHUB_OUTPUT" @@ -37,19 +36,21 @@ jobs: - name: Update generated docs if: steps.versions.outputs.should_update == 'true' + env: + LATEST_VERSION=${{ steps.versions.outputs.latest_version }} run: | sudo apt-get update sudo apt-get install -y libdbus-1-dev libglib2.0-dev pkg-config - git -C ../gitbutler checkout "${{ steps.versions.outputs.latest_release }}" + git -C ../gitbutler checkout "$LATEST_VERSION" ./scripts/update-manpages.sh - sed -i "s|CURRENT_DOCS_VERSION: .*|CURRENT_DOCS_VERSION: ${{ steps.versions.outputs.latest_release }}|" .github/workflows/update-generated-docs.yml + sed -i "s|CURRENT_DOCS_VERSION: .*|CURRENT_DOCS_VERSION: $LATEST_VERSION|" .github/workflows/update-generated-docs.yml git config user.name "github-actions[bot]" git config user.email "41898282+github-actions[bot]@users.noreply.github.com" - branch="test-generated-docs-${{ github.run_id }}" + branch="update-generated-docs-$LATEST_VERSION" git checkout -b "$branch" git add . git commit -m "Update CLI docs" From 03b01acea4aa5ef355d956ad6d09a9adc58ac453 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20Lars=C3=A9n?= Date: Thu, 18 Jun 2026 11:05:06 +0200 Subject: [PATCH 14/25] tmp --- .github/workflows/update-generated-docs.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/update-generated-docs.yml b/.github/workflows/update-generated-docs.yml index b03bb46..a953eb0 100644 --- a/.github/workflows/update-generated-docs.yml +++ b/.github/workflows/update-generated-docs.yml @@ -14,8 +14,8 @@ jobs: contents: write steps: - uses: actions/checkout@v4 - with: - ref: main +# with: +# ref: main - run: | git clone https://github.com/gitbutlerapp/gitbutler ../gitbutler From c3a319b48573ea5affdde7bb03e99d7989f65113 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20Lars=C3=A9n?= Date: Thu, 18 Jun 2026 11:06:35 +0200 Subject: [PATCH 15/25] fix bad template --- .github/workflows/update-generated-docs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/update-generated-docs.yml b/.github/workflows/update-generated-docs.yml index a953eb0..319d1ae 100644 --- a/.github/workflows/update-generated-docs.yml +++ b/.github/workflows/update-generated-docs.yml @@ -37,7 +37,7 @@ jobs: - name: Update generated docs if: steps.versions.outputs.should_update == 'true' env: - LATEST_VERSION=${{ steps.versions.outputs.latest_version }} + LATEST_VERSION: ${{ steps.versions.outputs.latest_version }} run: | sudo apt-get update sudo apt-get install -y libdbus-1-dev libglib2.0-dev pkg-config From 4f034708bec985787be2b3fc8c726a75bce6f35c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20Lars=C3=A9n?= Date: Thu, 18 Jun 2026 11:10:12 +0200 Subject: [PATCH 16/25] tweak --- .github/workflows/update-generated-docs.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/update-generated-docs.yml b/.github/workflows/update-generated-docs.yml index 319d1ae..0db594f 100644 --- a/.github/workflows/update-generated-docs.yml +++ b/.github/workflows/update-generated-docs.yml @@ -24,7 +24,10 @@ jobs: id: versions run: | CURRENT_DOCS_VERSION=$(cat .github/workflows/current_docs_version.txt) - LATEST_VERSION=$(git -C ../gitbutler tag --sort=-version:refname | grep '^nightly/' | head -n 1) + LATEST_VERSION=$(git -C ../gitbutler tag --list 'nightly/*' --sort=-version:refname | head -n 1) + + echo "Current: $CURRENT_DOCS_VERSION" + echo "Latest: $LATEST_VERSION" echo "latest_version=$LATEST_VERSION" >> "$GITHUB_OUTPUT" From 9b3878ea2bab79f36e8cf51f99f5d49455eac8c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20Lars=C3=A9n?= Date: Thu, 18 Jun 2026 11:11:03 +0200 Subject: [PATCH 17/25] downgrade current version --- .github/workflows/current_docs_version.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/current_docs_version.txt b/.github/workflows/current_docs_version.txt index 9acc19d..1a4dc4e 100644 --- a/.github/workflows/current_docs_version.txt +++ b/.github/workflows/current_docs_version.txt @@ -1 +1 @@ -nightly/0.5.2078 +nightly/0.5.2077 From 64a0205e75774d10f09ce95662e804c4dcdb4dad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20Lars=C3=A9n?= Date: Thu, 18 Jun 2026 11:14:58 +0200 Subject: [PATCH 18/25] tweak pr --- .github/workflows/update-generated-docs.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/update-generated-docs.yml b/.github/workflows/update-generated-docs.yml index 0db594f..0c2ec2f 100644 --- a/.github/workflows/update-generated-docs.yml +++ b/.github/workflows/update-generated-docs.yml @@ -63,10 +63,12 @@ jobs: - name: Create pull request if: steps.versions.outputs.should_update == 'true' + env: + LATEST_VERSION: ${{ steps.versions.outputs.latest_version }} run: | gh pr create \ - --title "Update generated CLI documentation" \ - --body "Created by CI" \ + --title "Update generated CLI documentation for version ${LATEST_VERSION}" \ + --body "Automatic docs update for ${LATEST_VERSION} @slarse" \ --base main \ --head "$branch" env: From bf5dfefab623af23aeabec5993fa070f38a7a77b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20Lars=C3=A9n?= Date: Thu, 18 Jun 2026 11:16:20 +0200 Subject: [PATCH 19/25] fix --- .github/workflows/update-generated-docs.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/update-generated-docs.yml b/.github/workflows/update-generated-docs.yml index 0c2ec2f..28f1266 100644 --- a/.github/workflows/update-generated-docs.yml +++ b/.github/workflows/update-generated-docs.yml @@ -63,8 +63,6 @@ jobs: - name: Create pull request if: steps.versions.outputs.should_update == 'true' - env: - LATEST_VERSION: ${{ steps.versions.outputs.latest_version }} run: | gh pr create \ --title "Update generated CLI documentation for version ${LATEST_VERSION}" \ @@ -73,3 +71,4 @@ jobs: --head "$branch" env: GH_TOKEN: ${{ secrets.GH_CREATE_PR_PAT }} + LATEST_VERSION: ${{ steps.versions.outputs.latest_version }} From 3a78dff22684ab2e7d0be02e3cd8283db99023a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20Lars=C3=A9n?= Date: Thu, 18 Jun 2026 11:23:19 +0200 Subject: [PATCH 20/25] update correct version --- .github/workflows/update-generated-docs.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/update-generated-docs.yml b/.github/workflows/update-generated-docs.yml index 28f1266..c067c4b 100644 --- a/.github/workflows/update-generated-docs.yml +++ b/.github/workflows/update-generated-docs.yml @@ -47,8 +47,7 @@ jobs: git -C ../gitbutler checkout "$LATEST_VERSION" ./scripts/update-manpages.sh - - sed -i "s|CURRENT_DOCS_VERSION: .*|CURRENT_DOCS_VERSION: $LATEST_VERSION|" .github/workflows/update-generated-docs.yml + echo "$LATEST_VERSION" > .github/workflows/current_docs_version.txt git config user.name "github-actions[bot]" git config user.email "41898282+github-actions[bot]@users.noreply.github.com" From 63825a0b1488562e933710fbe3afc3b63fd8f865 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20Lars=C3=A9n?= Date: Thu, 18 Jun 2026 11:31:45 +0200 Subject: [PATCH 21/25] final tweak (I hope) --- .github/workflows/update-generated-docs.yml | 16 ++++++++++------ .../current_docs_version.txt | 0 2 files changed, 10 insertions(+), 6 deletions(-) rename {.github/workflows => scripts}/current_docs_version.txt (100%) diff --git a/.github/workflows/update-generated-docs.yml b/.github/workflows/update-generated-docs.yml index c067c4b..cbf9d2e 100644 --- a/.github/workflows/update-generated-docs.yml +++ b/.github/workflows/update-generated-docs.yml @@ -1,13 +1,15 @@ name: "Update Generated Docs" on: - push: - branches: [GB-1405/automate-cli-docs-update] + workflow_dispatch: + schedule: + # every day at 2am UTC + - cron: "0 2 * * *" permissions: {} jobs: - test_create_pr: + update_generated_docs: runs-on: ubuntu-latest environment: Docs generation permissions: @@ -23,12 +25,14 @@ jobs: - name: Compare versions id: versions run: | - CURRENT_DOCS_VERSION=$(cat .github/workflows/current_docs_version.txt) + CURRENT_DOCS_VERSION=$(cat .scripts/current_docs_version.txt) LATEST_VERSION=$(git -C ../gitbutler tag --list 'nightly/*' --sort=-version:refname | head -n 1) echo "Current: $CURRENT_DOCS_VERSION" echo "Latest: $LATEST_VERSION" + test -n "$LATEST_VERSION" + echo "latest_version=$LATEST_VERSION" >> "$GITHUB_OUTPUT" if [ "$LATEST_VERSION" != "$CURRENT_DOCS_VERSION" ]; then @@ -47,7 +51,7 @@ jobs: git -C ../gitbutler checkout "$LATEST_VERSION" ./scripts/update-manpages.sh - echo "$LATEST_VERSION" > .github/workflows/current_docs_version.txt + echo "$LATEST_VERSION" > .scripts/current_docs_version.txt git config user.name "github-actions[bot]" git config user.email "41898282+github-actions[bot]@users.noreply.github.com" @@ -65,7 +69,7 @@ jobs: run: | gh pr create \ --title "Update generated CLI documentation for version ${LATEST_VERSION}" \ - --body "Automatic docs update for ${LATEST_VERSION} @slarse" \ + --body "Automatic docs update for ${LATEST_VERSION} @slarse @krlvi" \ --base main \ --head "$branch" env: diff --git a/.github/workflows/current_docs_version.txt b/scripts/current_docs_version.txt similarity index 100% rename from .github/workflows/current_docs_version.txt rename to scripts/current_docs_version.txt From 577dad1a0532c5fd9564fdf572916970d4210afd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20Lars=C3=A9n?= Date: Thu, 18 Jun 2026 11:42:33 +0200 Subject: [PATCH 22/25] Update --- .github/workflows/update-generated-docs.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/update-generated-docs.yml b/.github/workflows/update-generated-docs.yml index cbf9d2e..262dd42 100644 --- a/.github/workflows/update-generated-docs.yml +++ b/.github/workflows/update-generated-docs.yml @@ -51,7 +51,9 @@ jobs: git -C ../gitbutler checkout "$LATEST_VERSION" ./scripts/update-manpages.sh - echo "$LATEST_VERSION" > .scripts/current_docs_version.txt + + echo "Updating scripts/current_docs_version.txt to $LATEST_VERSION" + echo "$LATEST_VERSION" > scripts/current_docs_version.txt git config user.name "github-actions[bot]" git config user.email "41898282+github-actions[bot]@users.noreply.github.com" From 8df4a3e4ef3d6b53651b0e5357ef3442f3d8c47b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20Lars=C3=A9n?= Date: Thu, 18 Jun 2026 11:43:18 +0200 Subject: [PATCH 23/25] debug --- .github/workflows/update-generated-docs.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/update-generated-docs.yml b/.github/workflows/update-generated-docs.yml index 262dd42..8f17863 100644 --- a/.github/workflows/update-generated-docs.yml +++ b/.github/workflows/update-generated-docs.yml @@ -1,6 +1,8 @@ name: "Update Generated Docs" on: + push: + branches: [GB-1405/automate-cli-docs-update] workflow_dispatch: schedule: # every day at 2am UTC From 091ef726565e7a01c8315c3cbc021b62a193f211 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20Lars=C3=A9n?= Date: Thu, 18 Jun 2026 11:48:11 +0200 Subject: [PATCH 24/25] fix --- .github/workflows/update-generated-docs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/update-generated-docs.yml b/.github/workflows/update-generated-docs.yml index 8f17863..2368239 100644 --- a/.github/workflows/update-generated-docs.yml +++ b/.github/workflows/update-generated-docs.yml @@ -27,7 +27,7 @@ jobs: - name: Compare versions id: versions run: | - CURRENT_DOCS_VERSION=$(cat .scripts/current_docs_version.txt) + CURRENT_DOCS_VERSION=$(cat scripts/current_docs_version.txt) LATEST_VERSION=$(git -C ../gitbutler tag --list 'nightly/*' --sort=-version:refname | head -n 1) echo "Current: $CURRENT_DOCS_VERSION" From ec529b03cc988c4cf1436f6bad50db44e611729a Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 18 Jun 2026 09:53:42 +0000 Subject: [PATCH 25/25] Update CLI docs --- scripts/current_docs_version.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/current_docs_version.txt b/scripts/current_docs_version.txt index 1a4dc4e..9acc19d 100644 --- a/scripts/current_docs_version.txt +++ b/scripts/current_docs_version.txt @@ -1 +1 @@ -nightly/0.5.2077 +nightly/0.5.2078