-
Notifications
You must be signed in to change notification settings - Fork 561
ci: run link checker on PRs #2667
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
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
0415036
ci: run link checker on PRs
patrick-stephens bddc3f7
ci: split into separate jobs
patrick-stephens 9c9ef96
ci: switch to pinned hashes
patrick-stephens 401ea32
ci: allow for manual runs
patrick-stephens 78869fa
ci: do not fail for PRs
patrick-stephens 9033a9a
chore: update links
patrick-stephens 25dbf3b
Merge branch 'master' into ci_run_linkcheck_on_prs
patrick-stephens 3d57174
chore: resolve link failures
patrick-stephens dcec6c6
chore: add local link checker run
patrick-stephens File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| # Ignore certain landing pages for link checking, these may change redirects to internally | ||
| https://console.treasuredata.com/users/sign_in | ||
| https://app.datadoghq.com/logs/activation | ||
| # Ignore the redirects for Github logins when creating custom issues | ||
| ^https:\/\/github\.com\/fluent\/fluent-bit\/issues\/new\?.* |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| #!/bin/bash | ||
| set -euo pipefail | ||
|
|
||
| # This script is used to run the Lychee link checker in the same way that CI does in the GitHub Actions workflow. | ||
|
|
||
| SOURCE=${BASH_SOURCE[0]} | ||
| while [ -L "$SOURCE" ]; do | ||
| SCRIPT_DIR=$( cd -P "$( dirname "$SOURCE" )" >/dev/null 2>&1 && pwd ) | ||
| SOURCE=$(readlink "$SOURCE") | ||
| [[ $SOURCE != /* ]] && SOURCE=$SCRIPT_DIR/$SOURCE | ||
| done | ||
| SCRIPT_DIR=$( cd -P "$( dirname "$SOURCE" )" >/dev/null 2>&1 && pwd ) | ||
| REPO_DIR=${REPO_DIR:-$SCRIPT_DIR/..} | ||
|
|
||
| CONTAINER_IMAGE=${CONTAINER_IMAGE:-"ghcr.io/lycheeverse/lychee:latest"} | ||
| CONTAINER_RUNTIME=${CONTAINER_RUNTIME:-docker} | ||
|
|
||
| # Always pull the latest Lychee image to ensure we are validating against the most recent version. | ||
| if ! $CONTAINER_RUNTIME pull "$CONTAINER_IMAGE" &>/dev/null; then | ||
| echo "ERROR: Failed to pull container image $CONTAINER_IMAGE" >&2 | ||
| exit 1 | ||
| fi | ||
|
|
||
| # Matches the values in the GitHub Actions workflow for consistency. | ||
| LYCHEE_ARGS=${LYCHEE_ARGS:-"--accept '100..=103,200..=299,401,403,429,999' --verbose --no-progress ."} | ||
|
|
||
| # Run the Lychee link checker in a container with the same arguments as the GitHub Actions workflow. | ||
| # Note we do want arguments to be expanded here, so we don't quote $LYCHEE_ARGS. | ||
| # shellcheck disable=SC2086 | ||
| "$CONTAINER_RUNTIME" run --init -it -v "$REPO_DIR":/input:ro -e GITHUB_TOKEN="${GITHUB_TOKEN:-}" "$CONTAINER_IMAGE" $LYCHEE_ARGS |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.