Skip to content

Commit

Permalink
chore(renovate): monoupdate (#56)
Browse files Browse the repository at this point in the history
* chore: use lychee for link checking

* chore: make sure renovate use a single group
  • Loading branch information
leiicamundi authored May 21, 2024
1 parent f9b8d4e commit f268b83
Show file tree
Hide file tree
Showing 5 changed files with 61 additions and 27 deletions.
20 changes: 0 additions & 20 deletions .github/markdown-links.json

This file was deleted.

1 change: 1 addition & 0 deletions .github/renovate.json5
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
$schema: "https://docs.renovatebot.com/renovate-schema.json",
extends: ["github>camunda/infraex-common-config:default.json5"],
groupName: "mono-update-renovate", // we keep all updates in a single renovate branch in order to save CI tests
}
40 changes: 40 additions & 0 deletions .github/workflows/links.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Check external links

on:
push:
workflow_dispatch:
schedule:
- cron: "0 3 1 * *"

jobs:
lint:
name: links-check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4

- name: Get Current Timestamp
id: timestamp
run: echo "TIMESTAMP=$(date +%s)" >> "$GITHUB_ENV"

- name: Restore lychee cache
uses: actions/cache@e12d46a63a90f2fae62d114769bbf2a179198b5c # v3
with:
path: .lycheecache
key: "cache-lychee-${{ env.TIMESTAMP }}"
restore-keys: cache-lychee-

- name: Link Checker
uses: lycheeverse/lychee-action@2b973e86fc7b1f6b36a93795fe2c9c6ae1118621 # v1.10.0
with:
fail: true
args: -c ./lychee-links.toml --base . --cache --max-cache-age 1d . --verbose --no-progress '*.md' './**/*.md'
token: "${{ secrets.GITHUB_TOKEN }}"

- name: Create Issue From File
if: ${{ github.event_name == 'schedule' && env.lychee_exit_code != 0 }}
uses: peter-evans/create-issue-from-file@433e51abf769039ee20ba1293a088ca19d573b7f # v4
with:
title: Link Checker Report
content-filepath: ./lychee/out.md
labels: report, automated issue
8 changes: 1 addition & 7 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,18 +28,12 @@ repos:
args: ["--strict"]

- repo: https://github.com/compilerla/conventional-pre-commit
rev: v3.2.0
rev: v3.2.0 # use tags until renovate supports sha: https://github.com/renovatebot/renovate/issues/22567
hooks:
- id: conventional-pre-commit
stages: [commit-msg]
args: ["--strict" , "--force-scope"]

- repo: https://github.com/tcort/markdown-link-check
rev: v3.12.1 # use tags until renovate supports sha: https://github.com/renovatebot/renovate/issues/22567
hooks:
- id: markdown-link-check
args: [-q, -c .github/markdown-links.json]

- repo: https://github.com/antonbabenko/pre-commit-terraform
rev: v1.88.4
hooks:
Expand Down
19 changes: 19 additions & 0 deletions lychee-links.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Cache the results of Lychee if ran locally in order to minimise the chance of rate limiting
cache = true
# Ignore all private link (such as localhost) to avoid errors
exclude_all_private = true
# HTTP status code: 429 (Too Many Requests) will also be treated as a valid link if Lychee gets rate limited
accept = ["200", "403"]
# retry
max_retries = 6
retry_wait_time = 10
max_concurrency = 3

# Exclude all unsupported versioned_docs
exclude_path = [
]

# Explicitly exclude some URLs
exclude = [
"^file:",
]

0 comments on commit f268b83

Please sign in to comment.