Skip to content

librarian: sync missing CLI help blocks in reference docs 📚 #2565

librarian: sync missing CLI help blocks in reference docs 📚

librarian: sync missing CLI help blocks in reference docs 📚 #2565

Workflow file for this run

name: PR Cockpit
on:
pull_request:
types: [opened, synchronize]
permissions:
contents: read
pull-requests: write
env:
CARGO_TERM_COLOR: always
jobs:
cockpit:
name: PR Cockpit Report
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Fetch base branch
run: |
git fetch origin "${{ github.base_ref }}":"refs/remotes/origin/${{ github.base_ref }}" || true
- name: Set up Rust
uses: dtolnay/rust-toolchain@stable
- name: Cache Rust dependencies
uses: Swatinem/rust-cache@v2
with:
shared-key: cockpit
cache-on-failure: true
- name: Build and install tokmd
run: cargo install --path crates/tokmd --features git --locked
- name: Generate cockpit report
id: cockpit
run: |
set -euo pipefail
# Generate sections format for PR comment
tokmd cockpit --base "origin/${{ github.base_ref }}" --head HEAD --format sections > cockpit-sections.md
# Generate JSON receipt for artifact
tokmd cockpit --base "origin/${{ github.base_ref }}" --head HEAD --format json > cockpit-receipt.json
# Wrap sections with HTML comment markers for updateable comment
{
echo "<!-- SECTION:COCKPIT -->"
cat cockpit-sections.md
echo ""
echo "<!-- /SECTION:COCKPIT -->"
} > cockpit-comment.md
- name: Post or update PR comment
uses: thollander/actions-comment-pull-request@v3
with:
file-path: cockpit-comment.md
comment-tag: SECTION:COCKPIT
- name: Upload cockpit receipt
uses: actions/upload-artifact@v7
with:
name: cockpit-receipt
path: cockpit-receipt.json
retention-days: 30