Skip to content

Commit 48fc0da

Browse files
committed
ci(links): fix Lychee configuration and report the failures it finds
Signed-off-by: Ntege Daniel <danientege785@gmail.com>
1 parent c17aec1 commit 48fc0da

23 files changed

Lines changed: 196 additions & 50 deletions

.github/workflows/check-broken-links.yml

Lines changed: 79 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,38 @@ jobs:
2727
- name: Checkout repository
2828
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
2929

30+
# Persists .lycheecache between runs. Note that --max-cache-age below is
31+
# deliberately shorter than the weekly cron: every scheduled run re-checks
32+
# every URL from scratch, so a link that rots mid-week is still caught.
33+
# The cache exists to make same-day repeats cheap -- manual
34+
# workflow_dispatch runs and re-runs of a failed job -- rather than to
35+
# skip work on the weekly pass.
36+
- name: Restore Lychee cache
37+
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
38+
with:
39+
path: .lycheecache
40+
key: lychee-cache-${{ github.run_id }}
41+
restore-keys: |
42+
lychee-cache-
43+
3044
- name: Check Markdown links (Lychee)
3145
id: lychee
3246
uses: lycheeverse/lychee-action@e7477775783ea5526144ba13e8db5eec57747ce8 # v2.9.0
3347
continue-on-error: true
3448
with:
35-
args: --verbose --no-progress './**/*.md'
49+
# --root-dir is required for root-relative links such as
50+
# /images/foo.png to resolve against public/ instead of the
51+
# filesystem root; without it every such link is reported broken.
52+
# Concurrency, retries, timeout and accepted status codes come from
53+
# lychee.toml; skipped hosts come from .lycheeignore.
54+
args: >-
55+
--verbose
56+
--no-progress
57+
--root-dir "${{ github.workspace }}/public"
58+
--cache
59+
--max-cache-age 1d
60+
'./**/*.md'
61+
output: ./lychee/out.md
3662
fail: true
3763
token: ${{ secrets.GITHUB_TOKEN }}
3864

@@ -41,6 +67,8 @@ jobs:
4167
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
4268
with:
4369
script: |
70+
const fs = require('fs');
71+
4472
// Determine if this is a dry run
4573
const isManual = context.eventName === 'workflow_dispatch';
4674
const dryRun = isManual ? String(context.payload.inputs.dry_run).toLowerCase() === 'true' : false;
@@ -52,14 +80,55 @@ jobs:
5280
5381
console.log(`Event: ${context.eventName}, Dry Run: ${dryRun}`);
5482
55-
// Define Issue Body
56-
const body = `### 🔗 Broken Links Detected\n\n` +
57-
`The scheduled markdown link check workflow has detected broken links.\n\n` +
58-
`**Run Details:**\n` +
59-
`- **Timestamp:** ${new Date().toISOString()}\n` +
60-
`- **Workflow Run:** [View Logs](${runUrl})\n\n` +
61-
`> **Note:** We use [Lychee](https://github.com/lycheeverse/lychee) for link checking. ` +
62-
`Please check the "Check Markdown links" step in the logs to see the specific URLs that failed.`;
83+
// Pull in Lychee's own markdown report so the issue names the
84+
// offending URLs and their source files. Without this the report
85+
// only ever existed in the run logs, which is why this issue
86+
// accumulated timestamps with nothing actionable in them.
87+
//
88+
// GitHub rejects bodies over 65536 characters, so leave headroom
89+
// for the surrounding text and say so explicitly when truncating.
90+
const REPORT_LIMIT = 60000;
91+
const reportPath = './lychee/out.md';
92+
93+
function readReport() {
94+
try {
95+
const raw = fs.readFileSync(reportPath, 'utf8').trim();
96+
if (!raw) {
97+
console.log(`${reportPath} is empty; falling back to the log pointer.`);
98+
return null;
99+
}
100+
if (raw.length <= REPORT_LIMIT) return raw;
101+
return raw.slice(0, REPORT_LIMIT) +
102+
`\n\n> **Report truncated** at ${REPORT_LIMIT} characters. ` +
103+
`See the [full run logs](${runUrl}) for the complete list.`;
104+
} catch (error) {
105+
// A missing artefact must never fail the reporting step.
106+
console.log(`Could not read ${reportPath}: ${error.message}`);
107+
return null;
108+
}
109+
}
110+
111+
const report = readReport();
112+
const details = report
113+
? `<details open>\n<summary><strong>Lychee report</strong></summary>\n\n${report}\n\n</details>`
114+
: `> **Note:** The Lychee report could not be read for this run. ` +
115+
`Please check the "Check Markdown links (Lychee)" step in the logs ` +
116+
`to see the specific URLs that failed.`;
117+
118+
// Shared by both the create and the update path, so recurring
119+
// comments carry the current failure list rather than a timestamp.
120+
function buildBody(heading) {
121+
return `### 🔗 ${heading}\n\n` +
122+
`**Run Details:**\n` +
123+
`- **Timestamp:** ${new Date().toISOString()}\n` +
124+
`- **Workflow Run:** [View Logs](${runUrl})\n\n` +
125+
`${details}\n\n` +
126+
`> Link checking uses [Lychee](https://github.com/lycheeverse/lychee). ` +
127+
`Hosts that cannot be verified by a headless checker are listed, with reasons, ` +
128+
`in \`.lycheeignore\`.`;
129+
}
130+
131+
const body = buildBody('Broken Links Detected');
63132
64133
if (dryRun) {
65134
console.log("DRY RUN: Would have created or updated an issue.");
@@ -84,7 +153,7 @@ jobs:
84153
owner: context.repo.owner,
85154
repo: context.repo.repo,
86155
issue_number: existingIssue.number,
87-
body: `**Update ${new Date().toISOString()}:** Still finding broken links.\nCheck new run logs: ${runUrl}`
156+
body: buildBody('Still Finding Broken Links')
88157
});
89158
} else {
90159
console.log("Creating a new issue...");

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,3 +39,7 @@ yarn-error.log*
3939
# typescript
4040
*.tsbuildinfo
4141
next-env.d.ts
42+
43+
# lychee link checker (report output and response cache)
44+
/lychee/
45+
.lycheecache

.lycheeignore

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# URL patterns (regex) skipped by the weekly Lychee link check.
2+
# See .github/workflows/check-broken-links.yml and lychee.toml.
3+
#
4+
# Every entry must state WHY it is excluded. Only add a host here when it
5+
# cannot be verified by a headless checker -- a host that is genuinely dead
6+
# belongs in a content fix, not in this file.
7+
8+
# --- Hosts that reject non-browser clients -----------------------------------
9+
10+
# LFX meeting calendar: returns 403 to any client without a browser session.
11+
zoom-lfx\.platform\.linuxfoundation\.org
12+
13+
# Zoom join links: redirect to an auth wall for unauthenticated clients.
14+
zoom\.us
15+
16+
# Discord: answers 403/405 to bots on both the invite and app domains.
17+
discord\.(com|gg)
18+
19+
# LinkedIn: serves HTTP 999 (a non-standard bot deterrent) to all crawlers.
20+
linkedin\.com
21+
22+
# Meetup: behind Cloudflare bot protection, returns 403.
23+
meetup\.com
24+
25+
# HIP documents: hips.hedera.com answers 403 to non-browser clients. The pages
26+
# resolve normally in a browser, so this is bot protection, not a dead target.
27+
hips\.hedera\.com
28+
29+
# --- Hosts that are unreliable rather than hostile ---------------------------
30+
31+
# Contributor-stats API on a free Koyeb tier: cold starts exceed the timeout.
32+
# The endpoint is consumed at runtime by src/components/ContributorsGrid, so a
33+
# real outage surfaces on the site itself rather than only in this check.
34+
hedera-issues\.koyeb\.app
35+
36+
# --- Local development URLs --------------------------------------------------
37+
38+
# docs/setup/*.md document the local dev server; nothing listens on port 3000
39+
# inside CI, so this is expected to be unreachable there.
40+
^https?://localhost(:\d+)?
41+
42+
# --- Next.js routes with no counterpart under public/ ------------------------
43+
44+
# /heroes and /hacktoberfest are real routes (src/app/heroes, src/app/hacktoberfest)
45+
# but are rendered by Next.js, so --root-dir cannot resolve them to a file.
46+
# Matched on the resolved file:// URI that --root-dir produces.
47+
file:///.*/public/(heroes|hacktoberfest)$

README.md

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Hiero Website
22

33
[![OpenSSF Scorecard](https://api.scorecard.dev/projects/github.com/hiero-ledger/hiero-website/badge)](https://scorecard.dev/viewer/?uri=github.com/hiero-ledger/hiero-website)
4-
[![CII Best Practices](https://bestpractices.coreinfrastructure.org/projects/10697/badge)](https://bestpractices.coreinfrastructure.org/projects/10697)
4+
[![CII Best Practices](https://www.bestpractices.dev/projects/10697/badge)](https://www.bestpractices.dev/projects/10697)
55
[![License](https://img.shields.io/badge/license-MIT-green)](LICENSE)
66

77
Source code for [hiero.org](https://hiero.org) — the official website for the Hiero project.
@@ -70,9 +70,7 @@ Detailed documentation lives in the [`docs/`](docs/) directory. Below is a guide
7070

7171
| Guide | Description |
7272
| --- | --- |
73-
| [First Contribution Checklist](docs/05-first-contribution-checklist.md) | Pre-PR validation checklist |
74-
| [Contribution Workflow](docs/workflow.md) | End-to-end guide: fork, branch, commit, and submit a PR |
75-
| [Commit Signing Guide](docs/signing.md) | Setting up DCO and GPG signing |
73+
| [Testing and Quality Checks](docs/06-testing-and-quality-checks.md) | Pre-PR validation: format, lint, test, and build |
7674
| [Discord Guide](docs/discord.md) | Joining the community chat |
7775

7876
### For Developers
@@ -84,29 +82,21 @@ Detailed documentation lives in the [`docs/`](docs/) directory. Below is a guide
8482
| [Adding Pages](docs/03-adding-pages.md) | Creating new routes and markdown-backed pages |
8583
| [Components Guide](docs/04-components.md) | Component layout, imports, and testing conventions |
8684
| [Testing and Quality Checks](docs/06-testing-and-quality-checks.md) | Linting, testing, and CI expectations |
87-
| [Rebasing Guide](docs/rebasing.md) | Keeping your branch in sync with upstream |
88-
| [Merge Conflicts Guide](docs/merge_conflicts.md) | Resolving merge conflicts |
8985

9086
### For Content Authors
9187

9288
| Guide | Description |
9389
| --- | --- |
9490
| [Blog Writing Guide](docs/blogs.md) | Templates, front matter reference, and publishing workflow |
9591

96-
### For Maintainers
97-
98-
| Guide | Description |
99-
| --- | --- |
100-
| [GitHub Automation](docs/07-github-automation.md) | CI workflows and automation overview |
101-
10292
## Contributing
10393

10494
We welcome contributions of all kinds — code, documentation, and blog posts.
10595

10696
1. **Find an issue**: Browse [unassigned open issues](https://github.com/hiero-ledger/hiero-website/issues?q=is%3Aissue%20state%3Aopen%20no%3Aassignee) and comment `/assign` to claim one.
10797
2. **Set up your environment**: Follow the [Getting Started](#getting-started) section above.
108-
3. **Read the workflow**: See the [Contribution Workflow](docs/workflow.md) for the full process.
109-
4. **Sign your commits**: All commits must be DCO and GPG signed. See the [Signing Guide](docs/signing.md).
98+
3. **Read the docs**: Start with the [Repository Overview](docs/01-repo-overview.md), then run the [Testing and Quality Checks](docs/06-testing-and-quality-checks.md) before opening a PR.
99+
4. **Sign your commits**: All commits must be DCO and GPG signed.
110100

111101
New to the project? Start with a [Good First Issue](https://github.com/hiero-ledger/hiero-website/issues?q=is%3Aissue%20state%3Aopen%20label%3A%22good+first+issue%22%20no%3Aassignee).
112102

content/_index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ quote = '''
274274
&#8220;The HBAR Foundry community is excited to see the contribution of the Hedera software to the Linux Foundation Decentralized Trust project. We're delighted to see Hedera's commitment to growing an independently governed and transparent community with more resources and opportunities to engage and grow the ecosystem.&#8221;
275275
'''
276276
author = '''
277-
<a href="https://hbarfoundry.com/" target="_blank" rel="noreferrer noopener">The HBAR Foundry</a>, A Community Of Expert Hedera Builders
277+
The HBAR Foundry, A Community Of Expert Hedera Builders
278278
'''
279279
logo = "images/Hiero-Logo-HbarFoundry.png"
280280

content/hacktoberfest/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Your contributions can help us improve and expand the project, making it better
1111

1212
- **🌱 Learn and Grow**: Dive into open source, pick up new skills, and level up your coding game.
1313
- **🤝 Join the Community**: Connect with fellow developers, share knowledge, and build lasting relationships.
14-
You can find all heros that have already contributed to Hiero [here](/heros).
14+
You can find all heroes that have already contributed to Hiero [here](/heroes).
1515
- **🌍 Make an Impact**: Your code can make a difference, helping users around the globe.
1616

1717
## Hacktoberfest 2024

content/posts/get-involved/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ Whether you're a civic tech org, an NGO, a DAO, or an enterprise exploring verif
3131

3232

3333
## 📌 Not Ready to Run? List Yourself as an Adopter!
34-
Even if you’re not ready to run for a seat just yet, there’s still a meaningful way to contribute: **add your organization to the [adopters.md](https://github.com/hiero-identity/hiero/blob/main/adopters.md) file** in the Hiero GitHub repo.
34+
Even if you’re not ready to run for a seat just yet, there’s still a meaningful way to contribute: **add your organization to the [ADOPTERS.md](https://github.com/hiero-ledger/governance/blob/main/ADOPTERS.md) file** in the Hiero GitHub repo.
3535

3636
This public list of adopters helps:
3737
- Signal real-world demand for the protocol.

content/posts/hedera-devday-2026.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ image = "/images/profile-hiero.png"
1313

1414
On February 17th, builders, maintainers and ecosystem collaborators gathered in Denver for Hedera’s DevDay event. This was an exciting day for the Hedera community guided by exciting deep dive presentations into what’s next for the Hedera projects and the broader open source community around it.
1515

16-
Hosted as part of the Hedera community’s ongoing commitment to transparency and developer engagement, [Hedera DevDay 2026](https://devday.hedera.com/home) delivered roadmap updates, technical insights, hands-on demos, and exciting opportunities to collaborate across projects.
16+
Hosted as part of the Hedera community’s ongoing commitment to transparency and developer engagement, Hedera DevDay 2026 delivered roadmap updates, technical insights, hands-on demos, and exciting opportunities to collaborate across projects.
1717

18-
The [event's agenda](https://devday.hedera.com/agenda) featured several workshops including:
18+
The event's agenda featured several workshops including:
1919

2020
- Deploying Smart Contracts That Run Themselves
2121
- Designing for Scale: Batch 1,000 Records On-Chain Using Merkle Proofs

content/posts/hiero-graduation-with-further-reading.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ Graduation confirms that Hiero has achieved LFDT’s highest standards for:
5252
- **Neutral governance** and diverse community leadership.
5353
- **Production readiness** with enterprise-grade deployments (including powering the Hedera mainnet since February 2025).
5454
- **Security and compliance** with OpenSSF, GitHub Insights, and CI/CD best practices.
55-
- **Growing adoption** by enterprises, developers, and public sector innovators. [More Information](https://github.com/hiero-ledger/hiero/blob/main/ADOPTERS.md)
55+
- **Growing adoption** by enterprises, developers, and public sector innovators. [More Information](https://github.com/hiero-ledger/governance/blob/main/ADOPTERS.md)
5656

5757
---
5858

content/posts/hiero-hacktoberfest-2025.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,13 @@ This year, the Hiero project is excited to take part and welcome contributors of
2828
## Get Started with Hiero
2929

3030
We’ve prepared a set of issues that are perfect for newcomers to our project. You can find them in any repo in our [Hiero GitHub organization](https://github.com/hiero-ledger)
31-
under the label [good first issue](https://github.com/issues?q=is%3Aopen+is%3Aissue+org%3Ahiero-ledger+archived%3Afalse+label%3A%22good+first+issue%22+).
31+
under the label [good first issue](https://github.com/search?q=org%3Ahiero-ledger+label%3A%22good+first+issue%22+state%3Aopen&type=issues).
3232

3333
These issues are designed to be approachable and are a great way to learn how Hiero works while making a meaningful contribution.
3434

3535
## Guidelines for Good First Issues
3636

37-
To keep the experience smooth for both contributors and maintainers, we’ve documented clear [guidelines for creating and reviewing good first issues](https://github.com/hiero-ledger/governance/blob/main/guidelines/good-first-issues.md).
37+
To keep the experience smooth for both contributors and maintainers, we’ve documented clear [guidelines for creating and reviewing good first issues](https://github.com/hiero-ledger/governance/blob/main/rules-and-guidelines/good-first-issues.md).
3838
We encourage you to check them out and we welcome you to create more issues that new contributors can pick up.
3939

4040
## Why Contribute?

0 commit comments

Comments
 (0)