Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions .githooks/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/bin/sh
# Refreshes the README provider catalog from the production registry before each commit.
# Enable once per clone: git config core.hooksPath .githooks
# Skip for one commit: git commit --no-verify
# Never blocks a commit: any failure is reported and the commit proceeds without the refresh.

if ! command -v node >/dev/null 2>&1; then
echo "pre-commit: node not found; README.md provider catalog not refreshed" >&2
exit 0
fi

if ! git diff --quiet -- README.md; then
echo "pre-commit: README.md has unstaged changes; provider catalog not refreshed" >&2
exit 0
fi

if node scripts/docs/update_provider_listings.js --fetch; then
git add -- README.md
else
echo "pre-commit: provider catalog refresh failed; committing without it" >&2
fi
exit 0
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,12 @@ git fetch origin main
node scripts/docs/update_provider_listings.js
```

To refresh the catalog automatically on every commit, point Git at the repository hooks once per clone:

```bash
git config core.hooksPath .githooks
```

## Context


Expand Down
Binary file added images/ovh.ico
Binary file not shown.
Loading
Loading