docs: Update PRD and progress log for US-031 and US-032 completion #82
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Reduce Adoc | |
| on: | |
| push: | |
| paths: | |
| - '**/*-source.adoc' | |
| - 'pom.xml' | |
| branches: ['**'] | |
| workflow_dispatch: | |
| permissions: | |
| contents: write | |
| jobs: | |
| reduce: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Setup Ruby | |
| uses: ruby/setup-ruby@v1 | |
| with: | |
| ruby-version: '3.2' | |
| - name: Install asciidoctor-reducer | |
| run: gem install --no-document asciidoctor-reducer | |
| - name: Reduce all *-source.adoc files | |
| shell: bash | |
| run: | | |
| set -euo pipefail | |
| mapfile -d '' -t sources < <(find . -type f -name '*-source.adoc' -print0) | |
| for src in "${sources[@]}"; do | |
| out="${src%-source.adoc}.adoc" | |
| mkdir -p "$(dirname "$out")" | |
| echo "Reducing $src -> $out" | |
| asciidoctor-reducer --preserve-conditionals -o "$out" "$src" | |
| done | |
| - name: Replace version placeholders | |
| shell: bash | |
| run: | | |
| set -euo pipefail | |
| # Extract version from pom.xml using grep | |
| VERSION=$(grep -oP '<version>\K[^<]+' pom.xml | head -1) | |
| echo "Replacing {project-version} with $VERSION" | |
| # Replace in all generated .adoc files (but not -source.adoc files) | |
| find . -type f -name '*.adoc' ! -name '*-source.adoc' -exec sed -i "s/{project-version}/$VERSION/g" {} \; | |
| - name: Commit reduced files | |
| uses: EndBug/add-and-commit@v9 |