diff --git a/.github/workflows/repository-quality.yml b/.github/workflows/repository-quality.yml new file mode 100644 index 0000000..2703d9f --- /dev/null +++ b/.github/workflows/repository-quality.yml @@ -0,0 +1,56 @@ +name: Repository quality + +on: + pull_request: + push: + branches: [main] + +permissions: + contents: read + +jobs: + repository-quality: + runs-on: ubuntu-24.04 + steps: + - name: Check out repository + uses: actions/checkout@v4 + + - name: Verify governance baseline + shell: bash + run: | + set -euo pipefail + for file in README.md LICENSE CONTRIBUTING.md LICENSING.md NOTICE.md; do + test -s "$file" || { + echo "::error file=$file::$file is missing or empty" + exit 1 + } + done + + - name: Reject unresolved merge markers + shell: bash + run: | + set -euo pipefail + if git grep -nE '^(<<<<<<<|=======|>>>>>>>)' -- ':!*.patch' ':!*.diff' ':!*.md' ':!**/*.md'; then + echo "::error::Unresolved merge-conflict marker detected" + exit 1 + fi + + - name: Validate tracked JSON and XML + shell: python + run: | + import json + import subprocess + import xml.etree.ElementTree as ET + + def tracked(pattern): + output = subprocess.check_output( + ["git", "ls-files", pattern], text=True + ) + return [line for line in output.splitlines() if line] + + for path in tracked("*.json"): + with open(path, encoding="utf-8") as stream: + json.load(stream) + + for path in tracked("*.xml"): + ET.parse(path) diff --git a/README.md b/README.md index 489ca19..557f5db 100644 --- a/README.md +++ b/README.md @@ -42,6 +42,7 @@ The ecosystem encourages open-source collaboration, education, research, and ind - [Technical Steering](TECHNICAL_STEERING.md) - [Maintainers](MAINTAINERS.md) - [Roadmap](ROADMAP.md) +- [Documentation Standard](https://github.com/openAMRobot/openamrobot-docs/blob/main/docs/DOCUMENTATION_STANDARD.md) ## Contribution