diff --git a/.github/workflows/docs-version-on-tag.yml b/.github/workflows/docs-version-on-tag.yml index f00da17..1e3098d 100644 --- a/.github/workflows/docs-version-on-tag.yml +++ b/.github/workflows/docs-version-on-tag.yml @@ -1,4 +1,4 @@ -name: Docs Version on Tag +name: Version Docs on Tag on: push: @@ -46,32 +46,24 @@ jobs: pnpm --dir docs-site docusaurus docs:version "${VERSION}" fi - - name: Set default docs version - env: - VERSION: ${{ github.ref_name }} - run: | - set -euo pipefail - node -e "const fs=require('fs'); const file='docs-site/docusaurus.config.ts'; const source=fs.readFileSync(file,'utf8'); const updated=source.replace(/lastVersion:\s*'[^']*',/, \"lastVersion: '\" + process.env.VERSION + \"',\"); if (source===updated) { throw new Error('Unable to update lastVersion in docusaurus.config.ts'); } fs.writeFileSync(file, updated);" - - name: Build docs run: pnpm --dir docs-site build - name: Create docs version PR uses: peter-evans/create-pull-request@v6 with: - commit-message: docs: snapshot ${{ github.ref_name }} - title: docs: snapshot ${{ github.ref_name }} + commit-message: "docs: snapshot ${{ github.ref_name }}" + title: "docs: snapshot ${{ github.ref_name }}" body: | Automated docs version snapshot for `${{ github.ref_name }}`. - Ran `docusaurus docs:version` - - Updated `lastVersion` in `docs-site/docusaurus.config.ts` + - Added versioned docs/sidebar snapshot files branch: docs/version-${{ github.ref_name }} base: main delete-branch: true labels: docs,automation add-paths: | - docs-site/docusaurus.config.ts docs-site/versions.json docs-site/versioned_docs/** docs-site/versioned_sidebars/**