From 40610524199268bcc65bd49c8b28969ed91054e1 Mon Sep 17 00:00:00 2001 From: Andrew Teixeira Date: Tue, 23 Jan 2024 14:11:54 -0500 Subject: [PATCH] feat: add ADR TOC check feat: add docs to README --- .github/workflows/adr-check-toc.yaml | 34 ++++++++++++++++++++++++++++ README.md | 8 +++++++ 2 files changed, 42 insertions(+) create mode 100644 .github/workflows/adr-check-toc.yaml diff --git a/.github/workflows/adr-check-toc.yaml b/.github/workflows/adr-check-toc.yaml new file mode 100644 index 0000000..e96a2b1 --- /dev/null +++ b/.github/workflows/adr-check-toc.yaml @@ -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 }} diff --git a/README.md b/README.md index dfe319a..ac57bae 100644 --- a/README.md +++ b/README.md @@ -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