From 81c5db76589e2ae677722e37c30f61a79ee656f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Korbinian=20B=C3=B6sl?= Date: Thu, 5 Dec 2024 10:18:27 +0100 Subject: [PATCH 01/14] Create link-checker.yml --- .github/workflows/link-checker.yml | 53 ++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 .github/workflows/link-checker.yml diff --git a/.github/workflows/link-checker.yml b/.github/workflows/link-checker.yml new file mode 100644 index 0000000..53b1a11 --- /dev/null +++ b/.github/workflows/link-checker.yml @@ -0,0 +1,53 @@ +name: Link Checker + +on: + repository_dispatch: + workflow_dispatch: + 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: 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: report, automated issue From 617074244871847ba3e246cdaec7ac0f294d5cf6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Korbinian=20B=C3=B6sl?= Date: Thu, 5 Dec 2024 10:27:27 +0100 Subject: [PATCH 02/14] Update link-checker.yml --- .github/workflows/link-checker.yml | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/.github/workflows/link-checker.yml b/.github/workflows/link-checker.yml index 53b1a11..63a668f 100644 --- a/.github/workflows/link-checker.yml +++ b/.github/workflows/link-checker.yml @@ -2,7 +2,18 @@ name: Link Checker on: repository_dispatch: - workflow_dispatch: + workflow_dispatch: + inputs: + logLevel: + description: 'Log level' + required: true + default: 'warning' + type: choice + options: + - info + - warning + - debug + schedule: - cron: "00 18 * * *" From 90f00d2b25fec9a1863bef20e5798d0417be9a49 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Korbinian=20B=C3=B6sl?= Date: Thu, 5 Dec 2024 14:22:25 +0100 Subject: [PATCH 03/14] Update link-checker.yml --- .github/workflows/link-checker.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/link-checker.yml b/.github/workflows/link-checker.yml index 63a668f..2413ff6 100644 --- a/.github/workflows/link-checker.yml +++ b/.github/workflows/link-checker.yml @@ -54,6 +54,7 @@ jobs: args: _site/ --fallback-extensions .html # Don't fail action on broken links fail: false + lycheeVersion: 0.17.0 - name: Create Issue From File if: steps.lychee.outputs.exit_code != 0 From 98b4eada302a455389ad38b823c491dd1d357e25 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Korbinian=20B=C3=B6sl?= Date: Thu, 5 Dec 2024 14:35:49 +0100 Subject: [PATCH 04/14] Update link-checker.yml --- .github/workflows/link-checker.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/link-checker.yml b/.github/workflows/link-checker.yml index 2413ff6..f783617 100644 --- a/.github/workflows/link-checker.yml +++ b/.github/workflows/link-checker.yml @@ -63,3 +63,4 @@ jobs: title: Link Checker Report content-filepath: ./lychee/out.md labels: report, automated issue + issue-number: 12 From a96b43cddd44a11a98c7160aec2d3a8a556ccdf0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Korbinian=20B=C3=B6sl?= Date: Thu, 5 Dec 2024 14:40:34 +0100 Subject: [PATCH 05/14] Update link-checker.yml --- .github/workflows/link-checker.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/link-checker.yml b/.github/workflows/link-checker.yml index f783617..aed31d3 100644 --- a/.github/workflows/link-checker.yml +++ b/.github/workflows/link-checker.yml @@ -54,7 +54,6 @@ jobs: args: _site/ --fallback-extensions .html # Don't fail action on broken links fail: false - lycheeVersion: 0.17.0 - name: Create Issue From File if: steps.lychee.outputs.exit_code != 0 From dbf5e672fae8bdc9bd8b96c3038928e9ce48774a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Korbinian=20B=C3=B6sl?= Date: Thu, 5 Dec 2024 15:03:28 +0100 Subject: [PATCH 06/14] Update link-checker.yml --- .github/workflows/link-checker.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/link-checker.yml b/.github/workflows/link-checker.yml index aed31d3..5282c7e 100644 --- a/.github/workflows/link-checker.yml +++ b/.github/workflows/link-checker.yml @@ -54,7 +54,13 @@ jobs: args: _site/ --fallback-extensions .html # Don't fail action on broken links fail: false - + - name: Add repository URL + run: | + DEPLOY_URL=`https://plan.research-data.no/pages/` && \ + sed -i "s|_site\/|${DEPLOY_URL}|g" ./lychee/out.md && \ + cat ./lychee/out.md + + REPOSITORY_GITHUB_URL - name: Create Issue From File if: steps.lychee.outputs.exit_code != 0 uses: peter-evans/create-issue-from-file@v5 From d9802064ef0b265b79a950ae3aeb272da034e977 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Korbinian=20B=C3=B6sl?= Date: Thu, 5 Dec 2024 15:05:28 +0100 Subject: [PATCH 07/14] Update link-checker.yml --- .github/workflows/link-checker.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/link-checker.yml b/.github/workflows/link-checker.yml index 5282c7e..eabd3a9 100644 --- a/.github/workflows/link-checker.yml +++ b/.github/workflows/link-checker.yml @@ -55,7 +55,7 @@ jobs: # Don't fail action on broken links fail: false - name: Add repository URL - run: | + run: | DEPLOY_URL=`https://plan.research-data.no/pages/` && \ sed -i "s|_site\/|${DEPLOY_URL}|g" ./lychee/out.md && \ cat ./lychee/out.md From 012c5e865d288817572bed3db7851551bf56e560 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Korbinian=20B=C3=B6sl?= Date: Thu, 5 Dec 2024 15:06:14 +0100 Subject: [PATCH 08/14] Update link-checker.yml --- .github/workflows/link-checker.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/link-checker.yml b/.github/workflows/link-checker.yml index eabd3a9..985daa5 100644 --- a/.github/workflows/link-checker.yml +++ b/.github/workflows/link-checker.yml @@ -54,13 +54,12 @@ jobs: args: _site/ --fallback-extensions .html # Don't fail action on broken links fail: false - - name: Add repository URL + + - name: Add page URL run: | DEPLOY_URL=`https://plan.research-data.no/pages/` && \ sed -i "s|_site\/|${DEPLOY_URL}|g" ./lychee/out.md && \ - cat ./lychee/out.md - - REPOSITORY_GITHUB_URL + cat ./lychee/out.m - name: Create Issue From File if: steps.lychee.outputs.exit_code != 0 uses: peter-evans/create-issue-from-file@v5 From 6df6000d5c6fcb3873be087a334570e1987e2af8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Korbinian=20B=C3=B6sl?= Date: Thu, 5 Dec 2024 15:08:39 +0100 Subject: [PATCH 09/14] Update link-checker.yml --- .github/workflows/link-checker.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/link-checker.yml b/.github/workflows/link-checker.yml index 985daa5..b570396 100644 --- a/.github/workflows/link-checker.yml +++ b/.github/workflows/link-checker.yml @@ -57,7 +57,7 @@ jobs: - name: Add page URL run: | - DEPLOY_URL=`https://plan.research-data.no/pages/` && \ + DEPLOY_URL="https://plan.research-data.no/pages/" && \ sed -i "s|_site\/|${DEPLOY_URL}|g" ./lychee/out.md && \ cat ./lychee/out.m - name: Create Issue From File From d1ae5a3ae21ef5264b24e53d34a3d81cc0216883 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Korbinian=20B=C3=B6sl?= Date: Thu, 5 Dec 2024 15:11:48 +0100 Subject: [PATCH 10/14] Update link-checker.yml --- .github/workflows/link-checker.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/link-checker.yml b/.github/workflows/link-checker.yml index b570396..322d3fb 100644 --- a/.github/workflows/link-checker.yml +++ b/.github/workflows/link-checker.yml @@ -59,7 +59,8 @@ jobs: run: | DEPLOY_URL="https://plan.research-data.no/pages/" && \ sed -i "s|_site\/|${DEPLOY_URL}|g" ./lychee/out.md && \ - cat ./lychee/out.m + cat ./lychee/out.md + - name: Create Issue From File if: steps.lychee.outputs.exit_code != 0 uses: peter-evans/create-issue-from-file@v5 From f28637227b0a5e2b04ded5adde7b91c940914029 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Korbinian=20B=C3=B6sl?= Date: Thu, 5 Dec 2024 15:16:27 +0100 Subject: [PATCH 11/14] Update link-checker.yml --- .github/workflows/link-checker.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/link-checker.yml b/.github/workflows/link-checker.yml index 322d3fb..a840bd5 100644 --- a/.github/workflows/link-checker.yml +++ b/.github/workflows/link-checker.yml @@ -58,7 +58,7 @@ jobs: - name: Add page URL run: | DEPLOY_URL="https://plan.research-data.no/pages/" && \ - sed -i "s|_site\/|${DEPLOY_URL}|g" ./lychee/out.md && \ + sed -i "s|### Errors in _site\/|${DEPLOY_URL}|g" ./lychee/out.md && \ cat ./lychee/out.md - name: Create Issue From File From 71666ba63b27695588d1ddf81753042ddb952656 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Korbinian=20B=C3=B6sl?= Date: Thu, 5 Dec 2024 15:21:30 +0100 Subject: [PATCH 12/14] Update link-checker.yml --- .github/workflows/link-checker.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/link-checker.yml b/.github/workflows/link-checker.yml index a840bd5..9ce69f4 100644 --- a/.github/workflows/link-checker.yml +++ b/.github/workflows/link-checker.yml @@ -58,7 +58,7 @@ jobs: - name: Add page URL run: | DEPLOY_URL="https://plan.research-data.no/pages/" && \ - sed -i "s|### Errors in _site\/|${DEPLOY_URL}|g" ./lychee/out.md && \ + sed -i "s|\\#\\#\\# Errors in _site\/|${DEPLOY_URL}|g" ./lychee/out.md && \ cat ./lychee/out.md - name: Create Issue From File From 062e76fcc0ba7a151e7930381c171facd8b5d176 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Korbinian=20B=C3=B6sl?= Date: Thu, 5 Dec 2024 15:25:08 +0100 Subject: [PATCH 13/14] Update link-checker.yml --- .github/workflows/link-checker.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/link-checker.yml b/.github/workflows/link-checker.yml index 9ce69f4..1e3ae60 100644 --- a/.github/workflows/link-checker.yml +++ b/.github/workflows/link-checker.yml @@ -58,7 +58,7 @@ jobs: - name: Add page URL run: | DEPLOY_URL="https://plan.research-data.no/pages/" && \ - sed -i "s|\\#\\#\\# Errors in _site\/|${DEPLOY_URL}|g" ./lychee/out.md && \ + sed -i "s|\\#\\#\\# Errors in _site\/|\\#\\#\\# Errors in ${DEPLOY_URL}|g" ./lychee/out.md && \ cat ./lychee/out.md - name: Create Issue From File From 65595682c9f330c4e2c6e6ad33dbf375f4455830 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Korbinian=20B=C3=B6sl?= Date: Thu, 5 Dec 2024 16:08:46 +0100 Subject: [PATCH 14/14] Update link-checker.yml --- .github/workflows/link-checker.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/link-checker.yml b/.github/workflows/link-checker.yml index 1e3ae60..fc4a773 100644 --- a/.github/workflows/link-checker.yml +++ b/.github/workflows/link-checker.yml @@ -68,4 +68,4 @@ jobs: title: Link Checker Report content-filepath: ./lychee/out.md labels: report, automated issue - issue-number: 12 + issue-number: 166