From c5e23f61eb0692f7bfd42d0a34b407cdd5c84e07 Mon Sep 17 00:00:00 2001 From: Ernestas Kluonis Date: Sun, 1 Sep 2024 19:30:04 +0300 Subject: [PATCH] Added a workflows to check for broken links --- .github/workflows/check-links.yaml | 39 ++++++++++++++++++++++++++++ .github/workflows/check-pr-links.yml | 18 +++++++++++++ content.md | 8 +++--- lychee.toml | 20 ++++++++++++++ 4 files changed, 81 insertions(+), 4 deletions(-) create mode 100644 .github/workflows/check-links.yaml create mode 100644 .github/workflows/check-pr-links.yml create mode 100644 lychee.toml diff --git a/.github/workflows/check-links.yaml b/.github/workflows/check-links.yaml new file mode 100644 index 0000000..b4a4cbb --- /dev/null +++ b/.github/workflows/check-links.yaml @@ -0,0 +1,39 @@ +name: Check links + +on: + repository_dispatch: + workflow_dispatch: + schedule: + - cron: "0 18 * * *" + +jobs: + linkChecker: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Link Checker + id: lychee + uses: lycheeverse/lychee-action@v1 + with: + args: './content.md' + jobSummary: false + + - name: Find Link Checker Issue + id: link-checker-issue + uses: micalevisk/last-issue-action@v2 + with: + state: open + labels: | + link-checker + + - name: Update Issue + if: env.lychee_exit_code != 0 + uses: peter-evans/create-issue-from-file@v5 + with: + title: Broken links detected! + issue-number: "${{ steps.link-checker-issue.outputs.issue-number }}" + content-filepath: ./lychee/out.md + token: ${{secrets.GITHUB_TOKEN}} + labels: | + link-checker \ No newline at end of file diff --git a/.github/workflows/check-pr-links.yml b/.github/workflows/check-pr-links.yml new file mode 100644 index 0000000..c8f55b3 --- /dev/null +++ b/.github/workflows/check-pr-links.yml @@ -0,0 +1,18 @@ +name: Check PR Links + +on: + pull_request: + types: [opened, synchronize, reopened] + +jobs: + check-links: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Link Checker + uses: lycheeverse/lychee-action@v1 + with: + args: './content.md' + jobSummary: false + fail: true \ No newline at end of file diff --git a/content.md b/content.md index 8e6ae6a..6ef8b9f 100644 --- a/content.md +++ b/content.md @@ -5,9 +5,9 @@ A collection of tools and resources to enhance your gameplay! ### Tablets - [OpenTabletDriver](https://opentabletdriver.net/) - Open-source tablet driver - **Kuuube's Tablet Sheets and Guides** - - [Kuuube's Tablet Buying Guide](https://docs.google.com/spreadsheets/d/1DYVfiSpQqdpa4sWWYUALPmliOIuGyKog7B7LJJdmlhE) - - [Kuuube's Wacom Tablet Mastersheet](https://docs.google.com/spreadsheets/d/125LNzGmidy1gagwYUt12tRhrNdrWFHhWon7kxWY7iWU) - - [Kuuube's Wacom Tablet Pen Compatibility Mastersheet](https://docs.google.com/spreadsheets/d/1UAFPjGj0ThthPBvOSVVwOm08HW3qWtVoP1iFBwLMyPI) + - [Kuuube's Tablet Buying Guide](https://docs.google.com/spreadsheets/d/1DYVfiSpQqdpa4sWWYUALPmliOIuGyKog7B7LJJdmlhE/edit) + - [Kuuube's Wacom Tablet Mastersheet](https://docs.google.com/spreadsheets/d/125LNzGmidy1gagwYUt12tRhrNdrWFHhWon7kxWY7iWU/edit) + - [Kuuube's Wacom Tablet Pen Compatibility Mastersheet](https://docs.google.com/spreadsheets/d/1UAFPjGj0ThthPBvOSVVwOm08HW3qWtVoP1iFBwLMyPI/edit) - [Kuuube's Wacom Pen Nib Guide](https://kuuube.s-ul.eu/mSDcCpuh) --- ### Replay and Score Analysis @@ -82,4 +82,4 @@ These are some of the bots that can be used in the in-game chat. Find the accoun ### Misc - [osu!wiki](https://osu.ppy.sh/wiki/en/Main_page) - Tons of different articles about osu! - [osu! discord communities](https://osu.ppy.sh/wiki/en/Community/Discord_servers#official-osu!-server) - List of various discord servers made by the osu! community -- [Shikke's Anti-Mindblock](https://shikkesora.com/downloads) - A tool to quickly flip your monitor upside to help with mindblock +- [Shikke's Anti-Mindblock](https://shikkesora.com/downloads) - A tool to quickly flip your monitor upside to help with mindblock \ No newline at end of file diff --git a/lychee.toml b/lychee.toml new file mode 100644 index 0000000..0195e1b --- /dev/null +++ b/lychee.toml @@ -0,0 +1,20 @@ +verbose = "debug" +no_progress = true +max_retries = 3 + +# Treat a redirect as a new resource and report an error +max_redirects = 0 + +# Some websites do not like bots, so we pretend to be a browser +user_agent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36" + +exclude = [ + # Lychee reports an error when a link returns binary content + 'https://kuuube.s-ul.eu/mSDcCpuh', + + # YouTube seems to redirect for some reason + 'www.youtube.com', + + # Some websites do not like bots + 'https://score.kirino.sh/', +] \ No newline at end of file