From 116cd7aed6bc96ac85f5da579dbb14549808241c Mon Sep 17 00:00:00 2001 From: Gauarv Chaudhary Date: Thu, 4 Dec 2025 21:22:14 +0530 Subject: [PATCH] docs: fix dead links and add automated link checker - Fixed GitHub organization link from push-protocol to pushchain - Fixed Blog link from push-protocol to pushchain - Fixed CONTRIBUTING.md comment link from push-protocol to pushchain - Updated auto_add_project.yml project URL to pushchain org - Added GitHub Action workflow for automatic link checking - Workflow runs on PRs, pushes, and weekly schedule - Creates issues automatically when broken links are detected - Added .lycheeignore for permanent exclusions Fixes #192 --- .github/workflows/auto_add_project.yml | 2 +- .github/workflows/check-links.yml | 91 ++++++++++++++++++++++++++ .lycheeignore | 16 +++++ README.md | 6 +- 4 files changed, 111 insertions(+), 4 deletions(-) create mode 100644 .github/workflows/check-links.yml create mode 100644 .lycheeignore diff --git a/.github/workflows/auto_add_project.yml b/.github/workflows/auto_add_project.yml index 0fc12666..a9dd153a 100644 --- a/.github/workflows/auto_add_project.yml +++ b/.github/workflows/auto_add_project.yml @@ -12,5 +12,5 @@ jobs: steps: - uses: actions/add-to-project@v0.5.0 with: - project-url: https://github.com/orgs/push-protocol/projects/10 + project-url: https://github.com/orgs/pushchain/projects/10 github-token: ${{ secrets.ADD_TO_PROJECT_PAT }} \ No newline at end of file diff --git a/.github/workflows/check-links.yml b/.github/workflows/check-links.yml new file mode 100644 index 00000000..dcf11354 --- /dev/null +++ b/.github/workflows/check-links.yml @@ -0,0 +1,91 @@ +name: Check Links + +on: + pull_request: + branches: + - main + - dev + paths: + - '**.md' + - '**.mdx' + - 'docs/**' + push: + branches: + - main + schedule: + # Run weekly on Mondays at 9 AM UTC + - cron: '0 9 * * 1' + workflow_dispatch: + +jobs: + check-links: + runs-on: ubuntu-latest + name: Check for broken links + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + fetch-depth: 1 + + - name: Check links in Markdown files + uses: lycheeverse/lychee-action@v2 + with: + # Check all markdown files in the repository + args: | + --verbose + --no-progress + --max-retries 3 + --timeout 20 + --exclude-mail + --exclude-path node_modules + --exclude-path .git + --exclude-path build + --exclude-path dist + --exclude 'linkedin.com/in/*' + --exclude 'twitter.com/*' + --exclude 'x.com/*' + '**/*.md' + '**/*.mdx' + + # Fail action on broken links + fail: true + + # Output file for results + output: lychee-results.md + + # Format of the output + format: markdown + + - name: Create Issue on Failure + if: failure() + uses: peter-evans/create-issue-from-file@v5 + with: + title: 'Broken Links Detected' + content-filepath: lychee-results.md + labels: | + documentation + bug + + - name: Upload link check results + if: always() + uses: actions/upload-artifact@v4 + with: + name: link-check-results + path: lychee-results.md + retention-days: 30 + + - name: Comment PR with results + if: github.event_name == 'pull_request' && failure() + uses: actions/github-script@v7 + with: + script: | + const fs = require('fs'); + const results = fs.readFileSync('lychee-results.md', 'utf8'); + + github.rest.issues.createComment({ + issue_number: context.issue.number, + owner: context.repo.owner, + repo: context.repo.repo, + body: `## ⚠️ Broken Links Detected\n\n${results}\n\nPlease fix these broken links before merging.` + }); diff --git a/.lycheeignore b/.lycheeignore new file mode 100644 index 00000000..dc43fa62 --- /dev/null +++ b/.lycheeignore @@ -0,0 +1,16 @@ +# Ignore social media profile links (they often block bots) +https://twitter.com/* +https://x.com/* +https://linkedin.com/* +https://facebook.com/* + +# Ignore localhost links +http://localhost* +http://127.0.0.1* + +# Ignore example/placeholder URLs +https://example.com/* + +# Ignore any authentication-required URLs +**/login +**/signin diff --git a/README.md b/README.md index 3c8eb407..de1c3854 100644 --- a/README.md +++ b/README.md @@ -43,9 +43,9 @@ Click on the packages to view more details. - **[Website](https://push.org)** To checkout our Product. - **[Docs](https://push.org/docs)** For comprehensive documentation. -- **[Blog](https://medium.com/push-protocol)** To learn more about our partners, new launches, etc. +- **[Blog](https://medium.com/pushchain)** To learn more about our partners, new launches, etc. - **[Discord](https://discord.com/invite/pushchain)** for support and discussions with the community and the team. -- **[GitHub](https://github.com/push-protocol)** for source code, project board, issues, and pull requests. +- **[GitHub](https://github.com/pushchain)** for source code, project board, issues, and pull requests. - **[X/Twitter](https://x.com/pushchain)** for the latest updates on the product and published blogs. ## Contributing @@ -56,7 +56,7 @@ Push Protocol is an open source Project. We firmly believe in a completely trans - Feature Request: Please submit a feature request if you have an idea or discover a capability that would make development simpler and more reliable. - Documentation Request: If you're reading the Push documentation and believe that we're missing something, please create a docs request. - Not sure where to start? Join our discord and we will help you get started!