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
55 changes: 55 additions & 0 deletions .github/workflows/repository-quality-reusable.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Reusable repository quality

on:
workflow_call:

permissions:
contents: read

jobs:
repository-quality:
name: 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)
46 changes: 2 additions & 44 deletions .github/workflows/repository-quality.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,47 +10,5 @@ permissions:

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)
name: repository-quality
uses: ./.github/workflows/repository-quality-reusable.yml
Loading