Skip to content

Commit

Permalink
apply suggestions from code review
Browse files Browse the repository at this point in the history
  • Loading branch information
novusnota committed Jan 21, 2025
1 parent f123c4e commit f6f8225
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 11 deletions.
55 changes: 55 additions & 0 deletions .github/workflows/external-links.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Link check

on:
workflow_dispatch: # on demand launches, if needed
schedule:
- cron: "0 0 * * 2" # 00:00 on Tuesday, near the dependabot.yml

jobs:
linkcheck:
runs-on: ubuntu-latest
permissions:
issues: write # in order to create new issues
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: (docs) Check broken HTTPS links
uses: lycheeverse/lychee-action@v2
id: lychee
with:
args: >
-n -s https --exclude-path docs/node_modules
--base 'https://docs.tact-lang.org'
--exclude '.*?\\.(?:jpg|png)'
docs/README.md './docs/**/*.mdx'
output: "./out.md"
fail: false
failIfEmpty: false

- name: (dev-docs) Check broken HTTPS links
uses: lycheeverse/lychee-action@v2
id: lychee_dev
with:
args: >
-n -s https --exclude-path node_modules --exclude-path docs
'./**/*.md'
output: "./out_dev.md"
fail: false
failIfEmpty: false

- name: (docs) Create issue from the link-checking report
if: steps.lychee.outputs.exit_code != 0
uses: peter-evans/create-issue-from-file@v5
with:
title: "ci: Link checker report (docs)"
content-filepath: "./out.md"
labels: "kind: bug, kind: docs"

- name: (dev-docs) Create issue from the link-checking report
if: steps.lychee_dev.outputs.exit_code != 0
uses: peter-evans/create-issue-from-file@v5
with:
title: "ci: Link checker report (dev-docs)"
content-filepath: "./out_dev.md"
labels: "kind: bug, scope: dev-docs"
10 changes: 1 addition & 9 deletions .github/workflows/tact-docs-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,18 +50,10 @@ jobs:
working-directory: docs
run: yarn deps

- name: Check broken HTTPS links
uses: lycheeverse/lychee-action@v2
with:
args: "-n -s https -f compact --exclude-path docs/node_modules --base 'https://docs.tact-lang.org' --exclude '.*?\\.(?:jpg|png)' docs/README.md './docs/**/*.mdx'"
output: "/dev/null"
fail: true
failIfEmpty: false

- name: Check broken file references in README
uses: lycheeverse/lychee-action@v2
with:
args: "-n -s file -f compact docs/README.md"
args: "-n -s file docs/README.md"
output: "/dev/null"
fail: true
failIfEmpty: false
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/tact.yml
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,10 @@ jobs:
run: |
yarn knip
- name: Check broken links in internal documentation
- name: Check broken file references in internal documentation
uses: lycheeverse/lychee-action@v2
with:
args: "-n -f compact --exclude-path node_modules --exclude-path docs './**/*.md'"
args: "-n -s file --exclude-path node_modules --exclude-path docs './**/*.md'"
output: "/dev/null"
fail: true
failIfEmpty: false
Expand Down

0 comments on commit f6f8225

Please sign in to comment.