Skip to content

Commit f69e630

Browse files
committed
Put latest docs version outside workflow
1 parent e6018a5 commit f69e630

2 files changed

Lines changed: 10 additions & 8 deletions

File tree

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
nightly/0.5.2078

.github/workflows/update-generated-docs.yml

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@ jobs:
1212
environment: Docs generation
1313
permissions:
1414
contents: write
15-
env:
16-
CURRENT_DOCS_VERSION: nightly/0.5.2077
1715
steps:
1816
- uses: actions/checkout@v4
1917
with:
@@ -25,31 +23,34 @@ jobs:
2523
- name: Compare versions
2624
id: versions
2725
run: |
28-
LATEST_RELEASE=$(git -C ../gitbutler tag --sort=-version:refname | grep '^nightly/' | head -n 1)
26+
CURRENT_DOCS_VERSION=$(cat .github/workflows/current_docs_version.txt)
27+
LATEST_VERSION=$(git -C ../gitbutler tag --sort=-version:refname | grep '^nightly/' | head -n 1)
2928
30-
echo "latest_release=$LATEST_RELEASE" >> "$GITHUB_OUTPUT"
29+
echo "latest_version=$LATEST_VERSION" >> "$GITHUB_OUTPUT"
3130
32-
if [ "$LATEST_RELEASE" != "$CURRENT_DOCS_VERSION" ]; then
31+
if [ "$LATEST_VERSION" != "$CURRENT_DOCS_VERSION" ]; then
3332
echo "should_update=true" >> "$GITHUB_OUTPUT"
3433
else
3534
echo "should_update=false" >> "$GITHUB_OUTPUT"
3635
fi
3736
3837
- name: Update generated docs
3938
if: steps.versions.outputs.should_update == 'true'
39+
env:
40+
LATEST_VERSION=${{ steps.versions.outputs.latest_version }}
4041
run: |
4142
sudo apt-get update
4243
sudo apt-get install -y libdbus-1-dev libglib2.0-dev pkg-config
4344
44-
git -C ../gitbutler checkout "${{ steps.versions.outputs.latest_release }}"
45+
git -C ../gitbutler checkout "$LATEST_VERSION"
4546
./scripts/update-manpages.sh
4647
47-
sed -i "s|CURRENT_DOCS_VERSION: .*|CURRENT_DOCS_VERSION: ${{ steps.versions.outputs.latest_release }}|" .github/workflows/update-generated-docs.yml
48+
sed -i "s|CURRENT_DOCS_VERSION: .*|CURRENT_DOCS_VERSION: $LATEST_VERSION|" .github/workflows/update-generated-docs.yml
4849
4950
git config user.name "github-actions[bot]"
5051
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
5152
52-
branch="test-generated-docs-${{ github.run_id }}"
53+
branch="update-generated-docs-$LATEST_VERSION"
5354
git checkout -b "$branch"
5455
git add .
5556
git commit -m "Update CLI docs"

0 commit comments

Comments
 (0)