Skip to content

Commit

Permalink
Add link checker (#114)
Browse files Browse the repository at this point in the history
  • Loading branch information
koppor authored Mar 12, 2024
1 parent 2cf0ffb commit 12c6ae4
Show file tree
Hide file tree
Showing 8 changed files with 56 additions and 11 deletions.
43 changes: 43 additions & 0 deletions .github/workflows/check-links.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Check external href links

on:
pull_request:
push:
paths:
- '.github/workflows/check-links.yml'
- '**/*.md'
schedule:
- cron: "0 9 1 * *"
workflow_dispatch:

concurrency:
group: "${{ github.workflow }}-${{ github.head_ref }}"
cancel-in-progress: true

jobs:
lychee:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
show-progress: 'false'
- name: Restore lychee cache
uses: actions/cache@v3
with:
path: .lycheecache
key: cache-lychee-${{ github.sha }}
restore-keys: cache-lychee-
- name: Link Checker
id: lychee
uses: lycheeverse/[email protected]
with:
fail: true
args: --max-concurrency 1 --cache --no-progress --exclude-all-private './**/*.md'
keepalive:
name: Keepalive
runs-on: ubuntu-latest
permissions:
actions: write
steps:
- uses: actions/checkout@v4
- uses: gautamkrishnar/keepalive-workflow@v2
2 changes: 2 additions & 0 deletions .lycheeignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
0005-example\.md
https://medium\.com/.*
10 changes: 5 additions & 5 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
- Refined howto texts
- Disable [markdown-lint](https://github.com/DavidAnson/markdownlint)'s [MD013 - line length](https://github.com/DavidAnson/markdownlint/blob/master/doc/Rules.md#md013---line-length) for the ADR files.
- Added initial [markdownlint](https://github.com/DavidAnson/markdownlint) configuration file `.markdownlint`.
This can, for instance, be used by a [GitHub linting workflow](https://github.com/adr/madr/blob/main/.github/workflows/lint.yaml)
This can, for instance, be used by a [GitHub linting workflow](https://github.com/adr/madr/blob/develop/.github/workflows/lint.yaml)

### Changed

Expand Down Expand Up @@ -135,7 +135,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).

### Added

- Version of MADR into [ADR-0000](template/0000-use-markdown-architectural-decision-records.md) of the template. Fixes [#5](https://github.com/adr/madr/issues/5)
- Version of MADR into `ADR-0000` of the template. Fixes [#5](https://github.com/adr/madr/issues/5)
- `README.md`: Added wints on the filenames.
- More ADRs on MADR
- Added `LICENSE` file
Expand Down Expand Up @@ -186,10 +186,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
### Changed

- No change in the template itself.
- Use [adr-log](https://adr.github.io/adr-log/) to generate links to the ADRs in `docs/adr/index.md`.
- Use [adr-log](https://github.com/adr/adr-log?tab=readme-ov-file#adr-log-) to generate links to the ADRs in `docs/adr/index.md`.
- `template.md` is not part of the log, but a separate text block in `docs/adr/index.md`.
- Link to new homepage of MADR: <https://adr.github.io/madr/>.
- Refined justification of [ADR-0000](docs/adr/0000-use-markdown-architectural-decision-records.md).
- Refined justification of `ADR-0000`.
- Refined `README.md`.

### Fixed
Expand All @@ -201,7 +201,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).

First release of Markdown Architectural Decision Records.

[Unreleased]: https://github.com/adr/madr/compare/3.0.0...main
[Unreleased]: https://github.com/adr/madr/compare/3.0.0...develop
[3.0.0]: https://github.com/adr/madr/compare/3.0.0-beta.2...3.0.0
[3.0.0-beta.2]: https://github.com/adr/madr/compare/3.0.0-beta...3.0.0-beta.2
[3.0.0-beta]: https://github.com/adr/madr/compare/2.1.2...3.0.0-beta
Expand Down
2 changes: 1 addition & 1 deletion docs/decisions/0008-add-status-field.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ status: on hold
#### Examples

* ![Example "Use Angular" with "status: accepted"](0008-example-badge.png)
* [![Example "status: superseded"](https://img.shields.io/badge/status-superseeded_by_ADR_0001-orange.svg?style=flat-square)](https://github.com/adr/madr/blob/main/docs/decisions/0001-use-CC0-as-license.md)
* [![Example "status: superseded"](https://img.shields.io/badge/status-superseeded_by_ADR_0001-orange.svg?style=flat-square)](https://github.com/adr/madr/blob/develop/docs/decisions/0001-use-CC0-or-MIT-as-license.md)

---

Expand Down
2 changes: 1 addition & 1 deletion docs/decisions/0010-support-categories.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ ADRs are recorded. The number of ADRs grows and the context/topic/scope of ADRs
## Considered Options

* Use labels
* Add `* Category: CATEGORY` directly under the heading (similar to <https://gist.github.com/FaKeller/2f9c63b6e1d436abb7358b68bf396f57>)
* Add `* Category: CATEGORY` directly under the heading (similar to <https://gist.github.com/FaKleiser/2f9c63b6e1d436abb7358b68bf396f57>)
* Use YAML front matter
* Encode category in filename
* Use subfolders with local IDs
Expand Down
2 changes: 1 addition & 1 deletion docs/decisions/0014-allow-neutral-arguments.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ Shorter example for pros and cons:

### OK, because …

Real world example: <https://github.com/island-is/island.is/blob/main/handbook/technical-overview/adr/0005-error-tracking-and-monitoring.md>
Real world example: <https://github.com/island-is/handbook/blob/master/docs/adr/0005-error-tracking-and-monitoring.md>

```markdown
### Bugsnag
Expand Down
4 changes: 2 additions & 2 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ npm install madr && mkdir -p docs/decisions && cp node_modules/madr/template/* d
Note you can also use [other patterns for the directory format](https://github.com/joelparkerhenderson/architecture_decision_record#adr-file-name-conventions).
As a consequence, some existing tooling might not be applicable.

The filenames are following the pattern `NNNN-title-with-dashes.md` ([ADR-0005](docs/decisions/0005-use-dashes-in-filenames.md)), where
The filenames are following the pattern `NNNN-title-with-dashes.md` ([ADR-0005](decisions/0005-use-dashes-in-filenames.md)), where

* `NNNN` is a consecutive number and we assume that there won't be more than 9,999 ADRs in one repository.
* The title is stored using dashes and lowercase, because [adr-tools] also does that.
Expand All @@ -131,7 +131,7 @@ Since Markdown allows many styles, formatting can be inconsistent.
To notify about inconsistencies, [markdownlint](https://github.com/DavidAnson/markdownlint#markdownlint) has been invented.
There is an initial configuration for it at `template/.markdownlint`.
You can use that configuration in a GitHub workflow.
See [`.github/workflows/lint.yaml`](.github/workflows/lint.yaml) for an example.
See [`.github/workflows/lint.yaml`](https://github.com/adr/madr/blob/develop/.github/workflows/lint.yaml) for an example.

## Using MADR in large projects and product developments

Expand Down
2 changes: 1 addition & 1 deletion docs/tooling.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ This page lists tooling for MADR.

| Name | MADR Version | Comment |
| -- | -- | -- |
| [adr-log](https://github.com/adr/adr-log) | 2.1.2 | CLI to keep an `index.md` file updated with all ADRs |
| [adr-log](https://github.com/adr/adr-log?tab=readme-ov-file#adr-log-) | 2.1.2 | CLI to keep an `index.md` file updated with all ADRs |
| [ADR Manager](https://adr.github.io/adr-manager/) | 2.1.2 | Web-based UI connecting to GitHub to directly edit ADRs in a form-based way |
| [eADR](https://github.com/adr/e-adr) | 1.0.0 | Embed decisions in Java code as annotations (`@MADR(...)`) |
| [Hugo Markdown ADR Tools](https://github.com/butonic/adr-tools) | 2.1.2. | CLI to create and update ADRs |
Expand Down

0 comments on commit 12c6ae4

Please sign in to comment.