Skip to content

Commit

Permalink
change link checker
Browse files Browse the repository at this point in the history
Signed-off-by: Peppi-Lotta <[email protected]>
  • Loading branch information
peppi-lotta committed Nov 14, 2024
1 parent c742269 commit 1deb959
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 10 deletions.
37 changes: 27 additions & 10 deletions .github/workflows/broken-link-check.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,39 @@
name: Check Links

on:
workflow_dispatch:
schedule:
- cron: "0 0 * * 0"
- cron: "0 0 * * 0"
repository_dispatch: # run manually
types: [check-link]

permissions: {}

name: Broken Link Check
jobs:
check:
name: Broken Link Check
linkChecker:
runs-on: ubuntu-latest

permissions:
contents: read
issues: write

if: github.repository == 'metal3-io/metal3-io.github.io'
steps:
- name: Broken Link Check
uses: technote-space/broken-link-checker-action@b8332d945b97f8b52eb8d7d889a1e0e37106c1a9 # v2.3.2
- uses: actions/checkout@v4

- name: read urls from sitemap
id: extractUrls
run: echo "urls=$(curl -sL {insert sitemap.xml url here} | grep -o "<loc>[^<]*" | sed -e 's/<[^>]*>//g' | tr '\n' ' ')" >> $GITHUB_OUTPUT

- name: Link Checker Metal3.io Web Page
id: lycheemetal3io
uses: lycheeverse/[email protected]
with:
args: --user-agent "curl/8.4.0" ${{ steps.extractUrls.outputs.urls }}
output: /tmp/lychee_output.md

- name: Create Issue From File Metal3.io
if: steps.lycheemetal3io.outputs.exit_code != 0
uses: peter-evans/[email protected]
with:
title: Link Checker Report
content-filepath: /tmp/lychee_output.md
labels: |
report
automated issue
5 changes: 5 additions & 0 deletions .lycheeignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
https://localhost
http://localhost
https://0.0.0.0
http://0.0.0.0
https://github.com/issues

0 comments on commit 1deb959

Please sign in to comment.