2.home-manager/.github/workflows/validate-maintainers.yml
Austin Horstman defabc11ab ci: move validate maintainers logic to lib
Allow easily running the individual checks outside of GHA for easier
testing/modification.

Signed-off-by: Austin Horstman <khaneliman12@gmail.com>
2025-07-17 15:15:39 -05:00

49 lines
1.7 KiB
YAML

name: Validate maintainers.nix
on:
pull_request:
paths: ["modules/lib/maintainers.nix"]
workflow_dispatch:
inputs:
run_tests:
description: 'Run validation tests'
required: false
default: true
type: boolean
jobs:
validate-maintainers:
runs-on: ubuntu-latest
if: github.repository_owner == 'nix-community'
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Get Nixpkgs revision from flake.lock
id: get-nixpkgs
run: |
echo "rev=$(jq -r '.nodes.nixpkgs.locked.rev' flake.lock)" >> "$GITHUB_OUTPUT"
- name: Install Nix
uses: cachix/install-nix-action@v31
with:
nix_path: nixpkgs=https://github.com/NixOS/nixpkgs/archive/${{ steps.get-nixpkgs.outputs.rev }}.tar.gz
- name: Validate Nix syntax
run: ./lib/python/validate-maintainers-syntax.py
- name: Validate maintainer entries
run: ./lib/python/validate-maintainer-entries.py
- name: Check for duplicate maintainers
run: ./lib/python/check-duplicate-maintainers.py
- name: Test generation
if: inputs.run_tests == true
run: |
echo "🔍 Testing all-maintainers.nix generation..."
./lib/python/generate-all-maintainers.py
echo "🔍 Validating generated file..."
if nix eval --file ./all-maintainers.nix --json > /dev/null; then
echo "✅ Generated file has valid Nix syntax"
else
echo "❌ Generated file has invalid Nix syntax"
exit 1
fi
- name: Summary
run: |
echo "✅ All validation checks passed!"
echo "📋 The maintainers.nix file is ready for merge"