From 16a709be2cc900a552b92a4af3868a4c3f231d8f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Korbinian=20B=C3=B6sl?= Date: Thu, 5 Dec 2024 15:34:04 +0100 Subject: [PATCH 1/6] Create link-check.yml --- .github/workflows/link-check.yml | 71 ++++++++++++++++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 .github/workflows/link-check.yml diff --git a/.github/workflows/link-check.yml b/.github/workflows/link-check.yml new file mode 100644 index 000000000..32d405a20 --- /dev/null +++ b/.github/workflows/link-check.yml @@ -0,0 +1,71 @@ +name: Link Checker + +on: + repository_dispatch: + workflow_dispatch: + inputs: + logLevel: + description: 'Log level' + required: true + default: 'warning' + type: choice + options: + - info + - warning + - debug + + schedule: + - cron: "00 18 * * *" + +jobs: + linkChecker: + runs-on: ubuntu-latest + permissions: + issues: write + steps: + - uses: actions/checkout@v4 + + + - name: Setup Ruby + uses: ruby/setup-ruby@v1 + with: + ruby-version: '3.1' + bundler-cache: true + cache-version: 0 + + + - name: Install dependencies + run: | + bundle install + - name: Build with Jekyll + # Outputs to the './_site' directory by default + run: | + bundle exec jekyll build + env: + PAGES_REPO_NWO: ${{ github.repository }} + JEKYLL_BUILD_BRANCH: ${{ github.ref_name }} + JEKYLL_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Link Checker + id: lychee + uses: lycheeverse/lychee-action@v2 + with: + # Check all markdown, html and reStructuredText files in repo (default) + args: _site/ --fallback-extensions .html + # Don't fail action on broken links + fail: false + + - name: Add page URL + run: | + DEPLOY_URL="https://rdmkit.elixir-europe.org/" && \ + sed -i "s|\\#\\#\\# Errors in _site\/|\\#\\#\\# Errors in ${DEPLOY_URL}|g" ./lychee/out.md && \ + cat ./lychee/out.md + + - name: Create Issue From File + if: steps.lychee.outputs.exit_code != 0 + uses: peter-evans/create-issue-from-file@v5 + with: + title: Link Checker Report + content-filepath: ./lychee/out.md + labels: bug, automated issue + issue-number: 1570 From 63009700cf09ebfdb1950358e80fc9f22a6a368a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Korbinian=20B=C3=B6sl?= Date: Thu, 5 Dec 2024 16:48:30 +0100 Subject: [PATCH 2/6] Update .github/workflows/link-check.yml Co-authored-by: Bert Droesbeke <44875756+bedroesb@users.noreply.github.com> --- .github/workflows/link-check.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/link-check.yml b/.github/workflows/link-check.yml index 32d405a20..3a5deebbc 100644 --- a/.github/workflows/link-check.yml +++ b/.github/workflows/link-check.yml @@ -44,6 +44,7 @@ jobs: env: PAGES_REPO_NWO: ${{ github.repository }} JEKYLL_BUILD_BRANCH: ${{ github.ref_name }} + JEKYLL_ENV: production JEKYLL_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Link Checker From 871c6e9997973bb25b497931a4525fb0d94a432a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Korbinian=20B=C3=B6sl?= Date: Thu, 5 Dec 2024 16:49:25 +0100 Subject: [PATCH 3/6] Update link-check.yml --- .github/workflows/link-check.yml | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/.github/workflows/link-check.yml b/.github/workflows/link-check.yml index 3a5deebbc..e058101ed 100644 --- a/.github/workflows/link-check.yml +++ b/.github/workflows/link-check.yml @@ -1,19 +1,7 @@ name: Link Checker on: - repository_dispatch: workflow_dispatch: - inputs: - logLevel: - description: 'Log level' - required: true - default: 'warning' - type: choice - options: - - info - - warning - - debug - schedule: - cron: "00 18 * * *" From 12a065006d6ac553d6d684e96619bdfc12d5d737 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Korbinian=20B=C3=B6sl?= Date: Thu, 5 Dec 2024 17:05:54 +0100 Subject: [PATCH 4/6] Update link-check.yml --- .github/workflows/link-check.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/link-check.yml b/.github/workflows/link-check.yml index e058101ed..17a016286 100644 --- a/.github/workflows/link-check.yml +++ b/.github/workflows/link-check.yml @@ -43,6 +43,7 @@ jobs: args: _site/ --fallback-extensions .html # Don't fail action on broken links fail: false + lycheeVersion: nightly - name: Add page URL run: | From c12ca0a84c10d4e57893719794c877405273f047 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Korbinian=20B=C3=B6sl?= Date: Fri, 6 Dec 2024 09:07:09 +0100 Subject: [PATCH 5/6] Update link-check.yml --- .github/workflows/link-check.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/link-check.yml b/.github/workflows/link-check.yml index 17a016286..2fe5558d8 100644 --- a/.github/workflows/link-check.yml +++ b/.github/workflows/link-check.yml @@ -40,7 +40,7 @@ jobs: uses: lycheeverse/lychee-action@v2 with: # Check all markdown, html and reStructuredText files in repo (default) - args: _site/ --fallback-extensions .html + args: _site/ --fallback-extensions html # Don't fail action on broken links fail: false lycheeVersion: nightly From d9e768d94f362d62e2a8138b4f792ccc58b59cbf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Korbinian=20B=C3=B6sl?= Date: Fri, 6 Dec 2024 10:39:26 +0100 Subject: [PATCH 6/6] Update link-check.yml --- .github/workflows/link-check.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/link-check.yml b/.github/workflows/link-check.yml index 2fe5558d8..6be9d7502 100644 --- a/.github/workflows/link-check.yml +++ b/.github/workflows/link-check.yml @@ -40,7 +40,7 @@ jobs: uses: lycheeverse/lychee-action@v2 with: # Check all markdown, html and reStructuredText files in repo (default) - args: _site/ --fallback-extensions html + args: _site/ --fallback-extensions html --github-token ${{ secrets.GITHUB_TOKEN }} # Don't fail action on broken links fail: false lycheeVersion: nightly