feat(git-permission-guard): add centralized git/gh permission hook pl… #62
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: Validate Claude Code Plugin | |
| on: | |
| push: | |
| branches: ["**"] | |
| pull_request: | |
| branches: [main] | |
| permissions: | |
| contents: read | |
| jobs: | |
| validate: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v6 | |
| - name: Setup Go | |
| uses: actions/setup-go@v6 | |
| with: | |
| go-version: '1.25' | |
| - name: Install cclint | |
| run: | | |
| # Pin to specific commit for reproducibility | |
| go install github.com/dotcommander/cclint@latest | |
| echo "$HOME/go/bin" >> $GITHUB_PATH | |
| - name: Validate plugin structure | |
| run: | | |
| echo "Validating webfetch-guard plugin..." | |
| $HOME/go/bin/cclint webfetch-guard | |
| echo "Validating markdown-validator plugin..." | |
| $HOME/go/bin/cclint markdown-validator | |
| - name: Validate marketplace.json | |
| run: | | |
| echo "Validating marketplace configuration..." | |
| if [ -f ".claude-plugin/marketplace.json" ]; then | |
| jq empty .claude-plugin/marketplace.json | |
| fi | |
| - name: Validate hook scripts | |
| run: | | |
| echo "Checking hook scripts..." | |
| find . -name "*.py" -path "*/scripts/*" | while read -r script; do | |
| if [ -f "$script" ]; then | |
| echo "Validating Python syntax: $script" | |
| python3 -m py_compile "$script" | |
| echo "Checking executable permission: $script" | |
| if [ ! -x "$script" ]; then | |
| echo "ERROR: $script is not executable" | |
| exit 1 | |
| fi | |
| fi | |
| done | |
| find . -name "*.sh" -path "*/scripts/*" | while read -r script; do | |
| if [ -f "$script" ]; then | |
| echo "Validating Bash syntax: $script" | |
| bash -n "$script" | |
| echo "Checking executable permission: $script" | |
| if [ ! -x "$script" ]; then | |
| echo "ERROR: $script is not executable" | |
| exit 1 | |
| fi | |
| fi | |
| done | |
| - name: Validate JSON files | |
| run: | | |
| echo "Validating JSON syntax..." | |
| find . -name "*.json" ! -path "*/node_modules/*" | while read -r json_file; do | |
| echo "Checking $json_file" | |
| jq empty "$json_file" | |
| done | |
| - name: Run hook tests | |
| run: | | |
| echo "Running hook tests..." | |
| find . -name "test_*.py" -o -name "*_test.py" | while read -r test; do | |
| if [ -f "$test" ]; then | |
| echo "Running: $test" | |
| python3 "$test" | |
| fi | |
| done |