Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🌱 Add broken link check action #505

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

peppi-lotta
Copy link
Member

@peppi-lotta peppi-lotta commented Feb 24, 2025

Add lychee's broken link checker action. This checks all links except the ones specified in .lychee ignore. External links are checked as is. For internal .md links a corresponding file is looked for.

I have tried this workflow in my own fork. You can check the result here: https://github.com/peppi-lotta/metal3-docs/actions/runs/13492952293

fixes: #439

@metal3-io-bot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign dtantsur for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@metal3-io-bot metal3-io-bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Feb 24, 2025
Copy link
Member

@tuminoid tuminoid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to have this also enabled at PR level, but obviously it should not create issues but report in PR test.

@peppi-lotta peppi-lotta force-pushed the peppi-lotta/add-link-checker-action branch from 1a2a607 to 6c725b2 Compare February 24, 2025 08:29
@peppi-lotta peppi-lotta marked this pull request as draft February 24, 2025 08:52
@metal3-io-bot metal3-io-bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Feb 24, 2025
@peppi-lotta
Copy link
Member Author

We need to have this also enabled at PR level, but obviously it should not create issues but report in PR test.

Lychee has a workflow ready for PRs: https://lychee.cli.rs/github_action_recipes/pull-requests/

I think it actually smarter to add this workflow and the PR workflow to project-infra. These WFs are so general that we should be able to use the same here and in CAPM3, BMO and IPAM.

@tuminoid
Copy link
Member

We need to have this also enabled at PR level, but obviously it should not create issues but report in PR test.

Lychee has a workflow ready for PRs: https://lychee.cli.rs/github_action_recipes/pull-requests/

I think it actually smarter to add this workflow and the PR workflow to project-infra. These WFs are so general that we should be able to use the same here and in CAPM3, BMO and IPAM.

I agree, if lychee allows required repository specific configuration via the action configuration and/or repository specific configuration files. It would be great to have both scheduled and PR workflows all using lychee in all repos, and reusing the workflows from project-infra.

Copy link
Member

@Rozzii Rozzii left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree too We can have the lychee as a reusable workflow.

@peppi-lotta peppi-lotta force-pushed the peppi-lotta/add-link-checker-action branch 2 times, most recently from d73a61a to 8a1a52b Compare February 26, 2025 13:13
@peppi-lotta peppi-lotta marked this pull request as ready for review February 26, 2025 13:14
@metal3-io-bot metal3-io-bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Feb 26, 2025

on:
pull_request_target:
# edited is needed here as this workflow checks for PR meta content
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is false comment here, we don't check meta for links but content.

on:
pull_request_target:
# edited is needed here as this workflow checks for PR meta content
types: [opened, edited, reopened, synchronize, ready_for_review]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
types: [opened, edited, reopened, synchronize, ready_for_review]
types: [opened, reopened, synchronize, ready_for_review]


jobs:
check-pr-links:
uses: metal3-io/project-infra/.github/workflows/pr-link-check.yml@main
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing EOL

@@ -0,0 +1,17 @@
name: Sheduled Link Check
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
name: Sheduled Link Check
name: Scheduled Link Check


jobs:
check-links:
uses: metal3-io/project-infra/.github/workflows/broken-link-check.yml@main
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing EOL

Signed-off-by: peppi-lotta <[email protected]>
@peppi-lotta peppi-lotta force-pushed the peppi-lotta/add-link-checker-action branch from 8a1a52b to 49c4845 Compare February 26, 2025 13:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fix dead links at bmc-events.md
4 participants