diff --git a/.github/plugin/marketplace.json b/.github/plugin/marketplace.json deleted file mode 100644 index 75eaf33..0000000 --- a/.github/plugin/marketplace.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "name": "clockgrove", - "owner": { "name": "Clockgrove" }, - "metadata": { - "description": "Clockgrove engineering capability packages", - "version": "1.4.3" - }, - "plugins": [ - { - "name": "clockgrove-factory", - "description": "GitHub-native engineering-management capability package centered on Director.", - "version": "1.4.3", - "source": { - "source": "github", - "repo": "clockgrove/factory", - "sha": "a6721bcf98e786c2d26b3cb62c88df49d4d52334" - } - }, - { - "name": "clockgrove-skills", - "description": "Reusable Clockgrove product and engineering skills.", - "version": "1.0.1", - "source": { - "source": "github", - "repo": "clockgrove/skills", - "sha": "8f32ba61327bdbcee57971daa97a33095ba82042" - } - } - ] -} diff --git a/.github/workflows/validate-marketplace.yml b/.github/workflows/validate-marketplace.yml deleted file mode 100644 index ff56ac8..0000000 --- a/.github/workflows/validate-marketplace.yml +++ /dev/null @@ -1,17 +0,0 @@ -name: Validate Clockgrove Marketplace - -on: - pull_request: - push: - branches: [main] - -permissions: - contents: read - -jobs: - deterministic: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - name: Validate immutable marketplace pins - run: python3 scripts/validate-marketplace.py diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml new file mode 100644 index 0000000..e03ca48 --- /dev/null +++ b/.github/workflows/validate.yml @@ -0,0 +1,20 @@ +name: Validate + +on: + pull_request: + push: + branches: [main] + +permissions: + contents: read + +jobs: + deterministic: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Issue templates parse and carry a name, a description and a body + run: | + for f in .github/ISSUE_TEMPLATE/*.yml; do + yq -e '.name and .description and (.body | length > 0)' "$f" >/dev/null || { echo "::error file=$f::not a valid issue form"; exit 1; } + done diff --git a/scripts/validate-marketplace.py b/scripts/validate-marketplace.py deleted file mode 100644 index 72d59b0..0000000 --- a/scripts/validate-marketplace.py +++ /dev/null @@ -1,46 +0,0 @@ -#!/usr/bin/env python3 -from __future__ import annotations -import json, re, sys -from pathlib import Path - -ROOT = Path(__file__).resolve().parents[1] -path = ROOT/'.github/plugin/marketplace.json' -data = json.loads(path.read_text()) -errors: list[str] = [] - -def err(msg: str): errors.append(msg) - -if data.get('name') != 'clockgrove': err('marketplace name mismatch') -if data.get('metadata', {}).get('version') != '1.4.3': err('marketplace release version must be 1.4.3') -plugins = data.get('plugins') -if not isinstance(plugins, list): err('plugins must be a list'); plugins = [] -expected = { - 'clockgrove-factory': ('clockgrove/factory', '1.4.3'), - 'clockgrove-skills': ('clockgrove/skills', '1.0.1'), -} -seen = set() -for plugin in plugins: - name = plugin.get('name') - seen.add(name) - if name not in expected: - err(f'unexpected plugin {name}') - continue - expected_repo, expected_version = expected[name] - if plugin.get('version') != expected_version: err(f'{name}: expected version {expected_version}') - source = plugin.get('source', {}) - if source.get('source') != 'github': err(f'{name}: source must be github') - if source.get('repo') != expected_repo: err(f'{name}: wrong repo') - sha = source.get('sha') - if not isinstance(sha, str) or not re.fullmatch(r'[0-9a-f]{40}', sha): - err(f'{name}: source sha must be a full 40-character commit SHA') - if 'ref' in source: err(f'{name}: release source must use immutable sha, not a movable ref') - unexpected = set(source) - {'source', 'repo', 'sha'} - if unexpected: err(f'{name}: unexpected source fields: {sorted(unexpected)}') -if seen != set(expected): err(f'plugin inventory mismatch: {seen}') - -if errors: - print('Marketplace validation FAILED') - for e in errors: print(f'- {e}') - sys.exit(1) -print('Marketplace validation passed') -for plugin in plugins: print(f'- {plugin["name"]} {plugin["version"]} @ {plugin["source"]["sha"]}')