Skip to content

Merge pull request #520 from Yubico/automation/migration-docs-update #14

Merge pull request #520 from Yubico/automation/migration-docs-update

Merge pull request #520 from Yubico/automation/migration-docs-update #14

name: Migration Docs Update
on:
push:
branches: [ yubikit ]
workflow_dispatch:
permissions:
contents: write
pull-requests: write
concurrency:
group: migration-docs-update-yubikit
cancel-in-progress: false
jobs:
update:
runs-on: ubuntu-latest
steps:
- name: Check out source
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5
with:
fetch-depth: 0
ref: yubikit
- name: Fetch migration baselines
run: |
git fetch origin +refs/heads/develop:refs/remotes/origin/develop
git fetch origin +refs/heads/yubikit:refs/remotes/origin/yubikit
- name: Resolve migration range
id: range
shell: bash
run: |
state_path='docs/migration/.state.yml'
if [[ -f "$state_path" ]]; then
last=$(sed -n 's/^last_analyzed_commit:[[:space:]]*//p' "$state_path" | head -n 1)
else
last=''
fi
if [[ -z "$last" ]]; then
last='origin/yubikit^'
fi
echo "base_range=$last..HEAD" >> "$GITHUB_OUTPUT"
- name: Build migration context
shell: bash
run: |
bash ./scripts/migration/build-migration-context.sh \
--mode update \
--v1-baseline origin/develop \
--v2-branch origin/yubikit \
--base-range '${{ steps.range.outputs.base_range }}' \
--output-dir .migration-context
- name: Install Claude Code
run: |
curl -fsSL https://claude.ai/install.sh | bash -s 2.1.199
echo "$HOME/.local/bin" >> "$GITHUB_PATH"
- name: Update migration documentation
env:
CLAUDE_CODE_OAUTH_TOKEN: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
run: |
printf '%s\n' \
'Read and follow `.github/prompts/migration-docs-post-merge.md`.' \
'The generated context is in `.migration-context/`.' \
'Update only the allowed migration documentation files.' \
| "$HOME/.local/bin/claude" -p --allowedTools Read,Grep,Glob,Edit,Write
- name: Set up .NET SDK
uses: actions/setup-dotnet@c2fa09f4bde5ebb9d1777cf28262a3eb3db3ced7 # v5.2.0
with:
dotnet-version: "10.0.x"
- name: Validate migration documentation
run: dotnet toolchain.cs -- docs-qa
- name: Create migration documentation PR
uses: peter-evans/create-pull-request@22a9089034f40e5a961c8808d113e2c98fb63676 # v7
with:
branch: automation/migration-docs-update
base: yubikit
title: Update v1 to v2 migration documentation
commit-message: "docs: update migration documentation"
body: |
Automated migration documentation update for `${{ steps.range.outputs.base_range }}`.
Review the generated guide, map, changelog, and state changes before merging.
add-paths: |
docs/migration/v1-to-v2.md
docs/migration/v1-to-v2-map.yml
docs/migration/v1-to-v2-changelog.md
docs/migration/.state.yml