A tool used to audit GitHub Organisations for compliance with ONS' GitHub Usage Policy. Built using the KEH Policy Methods Library, this tool produces a report of the audit findings, which can be used to identify areas of non-compliance and inform remediation efforts. Additionally, these reports can track compliance over time, providing a historical record of the organisation's adherence to the policy, and its progress towards achieving compliance.
- GitHub Policy Audit
- Python 3.12 or higher
- Poetry for dependency management
- Node.js and npm for documentation linting (Markdownlint)
This project uses a Makefile to simplify common tasks. To see the available commands, run:
make helpThis repository uses MkDocs for documentation. The documentation source files are located in the docs directory.
MkDocs gets deployed to GitHub Pages using GitHub Actions. The workflow for this is located at .github/workflows/deploy-docs.yml.
Before deployment, another GitHub Action workflow runs to check that the documentation builds correctly and has no linting or formatting issues.
This workflow is located at .github/workflows/ci-docs.yml.
To run the documentation locally:
-
Create a Python virtual environment and activate it.
python -m venv venv source venv/bin/activate -
Install the dependencies for MkDocs.
make docs-install
-
Run the MkDocs development server.
make docs-serve
This repository has GitHub Actions workflows set up for linting and testing. The workflows are located at:
.github/workflows/ci-fmt.ymlfor linting and formatting checks (primary language)..github/workflows/ci-test.ymlfor running automated tests..github/workflows/ci-docs.ymlfor checking that the documentation builds correctly and has no linting or formatting issues..github/workflows/megalinter.ymlfor running MegaLinter, which checks for linting and formatting issues across multiple languages and file types (this is a catch-all linter)..github/workflows/deploy-docs.ymlfor deploying documentation to GitHub Pages.
To run the linters and formatters for the primary language (Python) locally, you can use the following command:
make lintTo apply automatic fixes for any linting or formatting issues found, you can use:
make fmtTo run the tests locally, you can use:
make test-unitThis repository uses MegaLinter for comprehensive linting across multiple languages and file types. We use this so that all additional assets in the repository (e.g. YAML files, Markdown files, etc.) are also linted and checked for formatting issues, without having to set up specific linters for each file type.
To run MegaLinter locally, you can use the following command:
make megalinterThis repository uses Markdownlint for linting the documentation. To run Markdownlint locally, you can use the following:
make docs-lintNote: This will install markdownlint-cli globally via npm if it is not already installed.
To apply automatic fixes for any linting issues found by Markdownlint, you can use:
make docs-fixTo test that the documentation builds correctly, you can use the following command:
make docs-buildNote: This depends on MkDocs being set up for the repository. Instructions for setting up MkDocs can be found in the Documentation section of this README.