Skip to content

docs(git-id-switcher): add Snyk badge #56

docs(git-id-switcher): add Snyk badge

docs(git-id-switcher): add Snyk badge #56

Workflow file for this run

name: Check README Sync
on:
pull_request:
paths:
- 'extensions/git-id-switcher/docs/i18n/en/README.md'
- 'extensions/git-id-switcher/README.md'
workflow_dispatch: # Manual trigger for verification
permissions: {}
# README auto-generation is handled by local pre-commit hook (husky)
# This workflow only verifies sync as a safety net
jobs:
check-sync:
name: Verify README is in sync
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Harden Runner
uses: step-security/harden-runner@fe104658747b27e96e4f7e80cd0a94068e53901d # v2.16.1
with:
egress-policy: audit
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Setup Node.js
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
with:
node-version: '24'
cache: 'npm'
cache-dependency-path: package-lock.json
# Install at root level for npm workspaces
- name: Install dependencies
run: npm ci
- name: Generate README (dry-run)
working-directory: extensions/git-id-switcher
run: npm run generate:readme
- name: Verify sync
working-directory: extensions/git-id-switcher
run: |
if git diff --quiet README.md; then
echo "✅ README.md is in sync with docs/i18n/en/README.md"
else
echo "::error::README.md is out of sync with docs/i18n/en/README.md"
echo ""
echo "The pre-commit hook should have handled this automatically."
echo "If you bypassed the hook, please run:"
echo ""
echo " cd extensions/git-id-switcher"
echo " npm run generate:readme"
echo " git add README.md"
echo " git commit --amend --no-edit"
echo ""
echo "Diff:"
git diff README.md
exit 1
fi