Skip to content

Commit 1bd09d5

Browse files
committed
ci: replace link checking step with lychee, update docs
1 parent a96121a commit 1bd09d5

2 files changed

Lines changed: 34 additions & 9 deletions

File tree

‎.github/workflows/ci.yml‎

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,14 @@ jobs:
3838
- name: Checkout repository
3939
uses: actions/checkout@v4
4040

41-
- name: Install brok (and dependencies)
42-
run: |
43-
wget https://github.com/smallhadroncollider/brok/releases/download/1.1.0/brok-1.1.0_x86-64-linux.deb
44-
sudo dpkg -i brok-1.1.0_x86-64-linux.deb
45-
4641
- name: Check for dead links
47-
# tcrf.net uses DDoS protection that breaks link checkers
48-
# <https://blog.xkeeper.net/uncategorized/tcrf-has-been-getting-ddosed/>
49-
run: brok --only-failures --ignore "https://tcrf.net" *.md
42+
uses: lycheeverse/lychee-action@v2.9.0
43+
with:
44+
# tcrf.net uses DDoS protection that breaks link checkers
45+
# <https://blog.xkeeper.net/uncategorized/tcrf-has-been-getting-ddosed/>
46+
args: >-
47+
--no-progress
48+
--max-retries 3
49+
--exclude '^https?://(www\.)?tcrf\.net'
50+
--exclude '^https?://([^/]+\.)?itch\.io'
51+
README.md

‎CONTRIBUTING.md‎

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,29 @@ If you are not confident in forking the repository, making the change and sendin
4747

4848
Before the PR gets approved and merged, we may require a number of reviews from our contributors.
4949

50+
### Checking your changes locally
51+
52+
CI runs two checks, here's how you can try them locally.
53+
54+
The list is linted with [awesome-lint](https://github.com/sindresorhus/awesome-lint), using only the rules listed in [`lint/lint.js`](lint/lint.js). With Node.js 20 or later and [Yarn](https://classic.yarnpkg.com/) installed, run from the `lint` folder:
55+
56+
```bash
57+
cd lint
58+
yarn install
59+
yarn lint
60+
```
61+
62+
Links are checked with [lychee](https://github.com/lycheeverse/lychee): install it following its [instructions](https://lychee.cli.rs/guides/getting-started/) (prebuilt binaries, Homebrew, Cargo, Docker and more) and run, from the root of the repository:
63+
64+
```bash
65+
lychee --no-progress --max-retries 3 \
66+
--exclude '^https?://(www\.)?tcrf\.net' \
67+
--exclude '^https?://([^/]+\.)?itch\.io' \
68+
README.md
69+
```
70+
71+
This reports the links in README.md that don't respond. tcrf.net and itch.io links are skipped, as their protection against automated traffic blocks link checkers. A link can fail because a site is temporarily down: try it in your browser before replacing it or opening an issue about it, and see [Removing unavailable resources](#removing-unavailable-resources).
72+
5073
### Website sync markers
5174

5275
The list in README.md is also published on [gbdev.io/resources](https://gbdev.io/resources). Two HTML comments, invisible when the README is rendered, mark the part of the file that gets copied to the website ([#203](https://github.com/gbdev/awesome-gbdev/issues/203)):
@@ -60,7 +83,7 @@ Please leave these markers where they are. When adding or editing resources you
6083

6184
### Website updates
6285

63-
Whenever README.md changes on `master`, the [Update gbdev.io](.github/workflows/dispatch-website.yml) workflow sends an `awesome-gbdev-updated` [`repository_dispatch`](https://docs.github.com/en/actions/writing-workflows/choosing-when-your-workflow-runs/events-that-trigger-workflows#repository_dispatch) event to [gbdev.github.io](https://github.com/gbdev/gbdev.github.io), which rebuilds and deploys the website with the new list. It can also be run manually from the Actions tab ("Run workflow").
86+
Whenever README.md changes on `master`, the [Update gbdev.io](.github/workflows/dispatch-website.yml) workflow sends an `awesome-gbdev-updated` [`repository_dispatch`](https://docs.github.com/en/actions/writing-workflows/choosing-when-your-workflow-runs/events-that-trigger-workflows#repository_dispatch) event to [gbdev.github.io](https://github.com/gbdev/gbdev.github.io), which rebuilds and deploys the website with the new content of the list. It can also be run manually from the Actions tab ("Run workflow").
6487

6588
The event is sent with the `GBDEV_IO_DISPATCH_TOKEN` repository secret: a fine-grained personal access token with access to `gbdev/gbdev.github.io` only (Contents: read and write). If it expires or is revoked, the workflow fails and the website stops picking up list changes: generate a new token and update the secret. See the [gbdev.github.io CONTRIBUTING.md](https://github.com/gbdev/gbdev.github.io/blob/dev/CONTRIBUTING.md) for the receiving side.
6689

0 commit comments

Comments
 (0)