Skip to content

Fail if the target document will be changed #30

@kumar303

Description

@kumar303

For the purpose of continuous integration (CI), I'd like a script that will fail (as in exit non-zero) when someone adds a new ADR record but forgets to update the table of contents.

It could look something like:

adr-log -d ./docs/adrs/ -i --disallow-changes

If that command would otherwise require updating / creating a file, it would fail. Such a failure probably indicates that the commit author forgot to re-generate the table of contents.

The current work around is something like this in a CI script:

adr-log -d ./docs/adrs/ -i 
# Check to see if any files were modified and exit non-zero:
git status ...

The workaround is not too bad but it requires relying on something like git within CI and some bash magic.

As a point of reference prettier --check exists for a similar use case.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions