docs-drift #4
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: docs-drift | |
| # SKILL.md fetches all endpoint mappings from developers.zerion.io at run time, | |
| # so the only part that can go stale is the provider list in the frontmatter | |
| # description (it drives skill triggering before the docs are ever fetched). | |
| # This check compares that list against the live migration hub weekly. | |
| on: | |
| schedule: | |
| - cron: "0 6 * * 1" | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| issues: write | |
| jobs: | |
| check: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Compare SKILL.md provider list with the live docs | |
| id: drift | |
| run: | | |
| curl -sf https://developers.zerion.io/migrate-to-zerion.md -o hub.md | |
| providers=$(grep -o 'title="From [^"]*"' hub.md | sed 's/^title="From //; s/"$//' | sort -u) | |
| count=$(echo "$providers" | grep -c . || true) | |
| if [ "$count" -lt 3 ]; then | |
| echo "Extracted only $count providers from the hub page; its markup likely changed. Fix the grep in this workflow." | |
| exit 1 | |
| fi | |
| missing="" | |
| while IFS= read -r p; do | |
| grep -qF "$p" SKILL.md || missing="$missing- $p"$'\n' | |
| done <<< "$providers" | |
| if [ -n "$missing" ]; then | |
| { | |
| echo "missing<<EOF" | |
| printf '%s' "$missing" | |
| echo "EOF" | |
| } >> "$GITHUB_OUTPUT" | |
| echo "Providers on the migration hub but absent from SKILL.md:" | |
| printf '%s' "$missing" | |
| exit 1 | |
| fi | |
| echo "SKILL.md provider list matches the migration hub ($count providers)." | |
| - name: Open issue on drift | |
| if: failure() && steps.drift.outputs.missing != '' | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| MISSING: ${{ steps.drift.outputs.missing }} | |
| run: | | |
| title="SKILL.md provider list is behind developers.zerion.io" | |
| if gh issue list --state open --search "in:title \"$title\"" --json number --jq length | grep -qv '^0$'; then | |
| echo "Drift issue already open, skipping." | |
| exit 0 | |
| fi | |
| gh issue create --title "$title" --body "$(printf 'The migration hub lists providers missing from the SKILL.md frontmatter description:\n\n%s\nUpdate the description so the skill still triggers on these provider names.\n\nHub: https://developers.zerion.io/migrate-to-zerion\n' "$MISSING")" |