Skip to content
Draft
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
35 changes: 35 additions & 0 deletions .github/ISSUE_TEMPLATE/bug.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Bug report
description: Something broke or behaves unexpectedly.
labels: [bug]
body:
- type: textarea
id: what
attributes:
label: What happened?
description: Describe the behavior you saw.
validations:
required: true
- type: textarea
id: expected
attributes:
label: What did you expect?
validations:
required: true
- type: textarea
id: repro
attributes:
label: Repro steps
description: Minimum steps to reproduce. Commands, inputs, environment.
render: shell
validations:
required: true
- type: input
id: version
attributes:
label: Version / commit
description: "e.g. v0.2.3 or abc123"
- type: textarea
id: context
attributes:
label: Additional context
description: Logs, screenshots, environment notes.
5 changes: 5 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
blank_issues_enabled: false
contact_links:
- name: Ask a question (Discussions)
url: https://github.com/makegov/mg-tools/discussions
about: For open-ended questions, use Discussions rather than an issue.
26 changes: 26 additions & 0 deletions .github/ISSUE_TEMPLATE/feature.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Feature request
description: Propose a new capability or enhancement.
labels: [enhancement]
body:
- type: textarea
id: problem
attributes:
label: Problem
description: What are you trying to do? What's in the way today?
validations:
required: true
- type: textarea
id: proposal
attributes:
label: Proposal
description: Rough shape of the solution. API, UX, or implementation notes.
validations:
required: true
- type: textarea
id: alternatives
attributes:
label: Alternatives considered
- type: textarea
id: context
attributes:
label: Additional context
22 changes: 22 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
## Summary

<!-- What does this PR do, at a glance? 1-3 bullets. -->

-

## Why

<!-- Motivation. Link issues: closes #123, refs #456 -->

## Testing

<!-- How to verify locally / in CI. -->

- [ ]
- [ ]

## Risks / follow-ups

<!-- Anything non-obvious? Migrations? Rollout order? Future cleanup? -->

-
30 changes: 30 additions & 0 deletions .github/workflows/changelog-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: changelog-check
on:
pull_request:
types: [opened, synchronize, reopened, ready_for_review]

jobs:
changelog:
name: Verify CHANGELOG entry
runs-on: ubuntu-latest
if: github.event.pull_request.draft == false
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Check for CHANGELOG diff
run: |
set -e
base="origin/${{ github.base_ref }}"
git fetch --no-tags --depth=50 origin "${{ github.base_ref }}"
changed=$(git diff --name-only "$base...HEAD")
echo "Changed files:"
echo "$changed"
# Skip if only docs/meta files changed.
if echo "$changed" | grep -vE '^(\.github/|docs/|README\.md$|CHANGELOG\.md$|\.gitignore$)' | grep -q .; then
if ! echo "$changed" | grep -qE '^(CHANGELOG\.md|docs/CHANGELOG\.md)$'; then
echo "::error::Source files changed but neither CHANGELOG.md nor docs/CHANGELOG.md updated."
exit 1
fi
fi
echo "OK."

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {contents: read}
Comment on lines +8 to +30
30 changes: 30 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: ci
on:
pull_request:
push:
branches: [main]

jobs:
python:
if: hashFiles('pyproject.toml') != ''
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: astral-sh/setup-uv@v4
- run: uv sync --all-extras
- run: uv run ruff check .
- run: uv run ruff format --check .
- run: uv run pytest -x

node:

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {contents: read}
Comment on lines +9 to +19
if: hashFiles('package.json') != ''
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
- run: npm ci
- run: npm run lint --if-present
- run: npm test

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {contents: read}
Comment on lines +20 to +30
67 changes: 67 additions & 0 deletions .github/workflows/docs-dispatch.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: Docs dispatch

# Fires on push to the repo's default branch when content that affects external
# docs (or the public changelog) changes. Notifies the composer repo
# (makegov/docs) via repository_dispatch so it rebuilds without waiting for
# someone to push to docs directly.
#
# Installed by mg-tools into repos whose docsRole is `coloc-source` or
# `editorial-split-source`. For editorial-split repos (e.g. tango), the
# external paths watched are narrower — only docs/CHANGELOG.md and
# docs/internal/** (since the rest of external docs lives in the composer).
#
# Required secrets:
# DOCS_DISPATCH_TOKEN — GitHub token with repo:write on makegov/docs
#
# Required variables (optional):
# DOCS_TARGET_REPO — override target (default: makegov/docs)
#
# On install, mg-tools substitutes the path filters based on docsRole.

on:
push:
branches:
- main
- master
- staging
paths:
- "docs/**"
- "docs/CHANGELOG.md"
- "README.md"
workflow_dispatch:

jobs:
dispatch:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 2

- name: Detect changed paths
id: changes
run: |
set -euo pipefail
# Default to all-on-first-commit if there's only one commit in the ref.
base=$(git rev-parse HEAD~1 2>/dev/null || git rev-parse HEAD)
changed=$(git diff --name-only "$base" HEAD | paste -sd, -)
echo "changed=$changed" >> "$GITHUB_OUTPUT"
if [[ -n "$changed" ]]; then
echo "has_changes=true" >> "$GITHUB_OUTPUT"
else
echo "has_changes=false" >> "$GITHUB_OUTPUT"
fi

- name: Dispatch to docs composer
if: steps.changes.outputs.has_changes == 'true'
env:
GH_TOKEN: ${{ secrets.DOCS_DISPATCH_TOKEN }}
TARGET: ${{ vars.DOCS_TARGET_REPO || 'makegov/docs' }}
run: |
gh api "repos/$TARGET/dispatches" \
-f event_type=external_updated \
-f "client_payload[source_repo]=${{ github.repository }}" \
-f "client_payload[source_ref]=${{ github.sha }}" \
-f "client_payload[changed_paths]=${{ steps.changes.outputs.changed }}"
15 changes: 14 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -149,4 +149,17 @@ Thumbs.db
yoni/
.cursor/*

examples/
examples/

# --- mg-tools (per-developer; re-run 'mg-tools install' after clone) ---
.claude-plugin/
.claude/settings.json
.claude/settings.local.json
.claude/mg-tools-integration.md
.mcp.json
.mcp.disabled.json
.mg-tools/
.claude.bak.*
.cursor.bak.*
.mcp.json.bak.*
CLAUDE.md
Loading