Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add ADR TOC check #36

Merged
merged 1 commit into from
Jan 26, 2024
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
34 changes: 34 additions & 0 deletions .github/workflows/adr-check-toc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
---
'on':
workflow_call:
inputs:
jobs_run_on:
default: ubuntu-latest
description: The runner group on which jobs will run.
required: false
type: string
timeout_minutes:
description: The maximum time (in minutes) for a job to run.
default: 5
required: false
type: number
working_directory:
description: The working directory where all jobs should be executed.
default: '.'
required: false
type: string

jobs:
adr-check-toc:
defaults:
run:
working-directory: ${{ inputs.working_directory }}
runs-on: ${{ inputs.jobs_run_on }}
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Install adr tools
run: git clone https://github.com/npryce/adr-tools.git
- name: 'Test for uncommitted changes'
run: adr-tools/src/adr generate toc | diff README.md -
timeout-minutes: ${{ inputs.timeout_minutes }}
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,14 @@ parameters that can be passed with `with:` from calling repositories:
* `working_directory`: The working directory where all jobs should be executed.
Default: `.`

### adr-check-toc.yaml

This workflow will run the `adr generate toc` command using
[adr](https://github.com/npryce/adr-tools) to generate the Table of Contents for the
ADRs in the repository. The workflow assumes the output goes to the `README.md` in the
same directory as the ADRs. This check makes sure PRs haven't forgotten to run this
command as part of their commits.

### conventional-commit.yaml

This workflow will run the
Expand Down
Loading