File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -12,19 +12,37 @@ jobs:
1212 environment : Docs generation
1313 permissions :
1414 contents : write
15+ env :
16+ CURRENT_DOCS_VERSION : release/0.20.0
1517 steps :
1618 - uses : actions/checkout@v4
1719 with :
1820 ref : main
1921
2022 - run : |
21- sudo apt-get update
22- sudo apt-get install -y libdbus-1-dev pkg-config
23+ git clone https://github.com/gitbutlerapp/gitbutler ../gitbutler
2324
24- - run : git clone --depth=1 https://github.com/gitbutlerapp/gitbutler ../gitbutler
25- - run : ./scripts/update-manpages.sh
25+ - id : versions
26+ run : |
27+ LATEST_RELEASE=$(git -C ../gitbutler tag --sort=-version:refname | grep '^release/' | head -n 1)
28+
29+ echo "latest_release=$LATEST_RELEASE" >> "$GITHUB_OUTPUT"
30+
31+ if [ "$LATEST_RELEASE" != "$CURRENT_DOCS_VERSION" ]; then
32+ echo "should_update=true" >> "$GITHUB_OUTPUT"
33+ else
34+ echo "should_update=false" >> "$GITHUB_OUTPUT"
35+ fi
36+
37+ - if : steps.versions.outputs.should_update == 'true'
38+ run : |
39+ sudo apt-get update
40+ sudo apt-get install -y libdbus-1-dev libglib2.0-dev pkg-config
41+
42+ ./scripts/update-manpages.sh
43+
44+ sed -i "s|CURRENT_DOCS_VERSION: .*|CURRENT_DOCS_VERSION: ${{ steps.versions.outputs.latest_release }}|" .github/workflows/update-generated-docs.yml
2645
27- - run : |
2846 git config user.name "github-actions[bot]"
2947 git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
3048
3654
3755 echo "branch=$branch" >> "$GITHUB_ENV"
3856
39- - run : |
57+ - if : steps.versions.outputs.should_update == 'true'
58+ run : |
4059 gh pr create \
4160 --title "Update generated CLI documentation" \
4261 --body "Created by CI" \
You can’t perform that action at this time.
0 commit comments