Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
84 changes: 84 additions & 0 deletions .github/lychee.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
# .github/lychee.toml

############################# Display #############################
# Verbose program output
# Accepts log level: "error", "warn", "info", "debug", "trace"
verbose = "info"

# Don't show interactive progress bar while checking links.
no_progress = false

############################# Cache ###############################
# Enable link caching. This can be helpful to avoid checking the same links on
# multiple runs.
cache = true

# Discard all cached requests older than this duration.
max_cache_age = "1d"

############################# Runtime #############################
# Maximum number of concurrent link checks.
max_concurrency = 12

# Maximum number of allowed redirects.
max_redirects = 10

# Maximum number of allowed retries before a link is declared dead.
max_retries = 5

############################# Requests ############################
# Website timeout from connect to response finished.
timeout = 60

# Minimum wait time in seconds between retries of failed requests.
retry_wait_time = 3

# Accept more status codes (follow redirects automatically)
accept = ["200..=204", "301..=308", "429"]

# Avoid false fragment errors
include_fragments = false

# Only test links with the given schemes (e.g. https).
# Omit to check links with any other scheme.
# At the moment, we support http, https, file, and mailto.
scheme = ["https"]

# When links are available using HTTPS, treat HTTP links as errors.
require_https = false

# Fallback extensions to apply when a URL does not specify one.
# This is common in documentation tools that cross-reference files without extensions.
fallback_extensions = ["md", "html"]

############################# Exclusions ##########################
# Check links inside `<code>` and `<pre>` blocks as well as Markdown code
# blocks.
include_verbatim = false

# Ignore case of paths when matching glob patterns.
glob_ignore_case = false

# Exclude URLs and mail addresses from checking (supports regex).
exclude = [
'^mailto:',
'^https?://localhost',
'^https?://127\\.0\\.0\\.1',
'^https://www\.linkedin\.com',
'^https?://web\\.archive\\.org/web/'
]

# Exclude these filesystem paths from getting checked.
exclude_path = [
'(^|/)node_modules/',
'(^|/)dist/',
'(^|/)bin/',
'\\.txt$', # skip .txt extensions
'(^|/)test/' # skip directories named "test"
]

# URLs to check (supports regex). Has preference over all excludes.
include = ['gist\.github\.com.*']

# Skip checking mail addresses
include_mail = true
90 changes: 90 additions & 0 deletions .github/workflows/check-pr-links.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
name: Check Links In Pull Requests

on:
pull_request:
branches:
- main
paths:
- '**/*.md' # Only trigger workflow if any Markdown files change

jobs:
check-links:
runs-on: ubuntu-latest
steps:
# Step 1: Checkout the repository
- name: Checkout GitHub repo
uses: actions/checkout@v4
with:
fetch-depth: 0

# Step 2: Check out base branch
- name: Check out base branch
run: git checkout ${{ github.event.pull_request.base.ref }}

# Step 3: Get changed Markdown files
- name: Get changed Markdown files
id: changed-files
run: |
mapfile -t files_array < <(git diff --name-only origin/${{ github.event.pull_request.base.ref }} ${{ github.head_ref }} | grep '\.md$' || true)
files=""
for f in "${files_array[@]}"; do
files="$files \"$f\""
done
echo "changed_files=$files" >> $GITHUB_ENV
echo "Changed Markdown files: $files"

# Step 4: Skip workflow if no Markdown files changed
- name: Skip if no Markdown files changed
if: ${{ env.changed_files == '' }}
run: |
echo "No Markdown files changed in this PR. Skipping link check."
exit 0

# Step 5: Dump base branch links for changed files only (no fragments)
- name: Dump base branch links
uses: lycheeverse/lychee-action@v2
with:
args: "--dump ${{ env.changed_files }}"
output: ./existing-links.txt
continue-on-error: true

# Step 6: Stash untracked files and switch back to feature branch
- name: Stash untracked files
run: git stash push --include-untracked

- name: Check out feature branch
run: git checkout ${{ github.head_ref }}

- name: Apply stashed changes
run: git stash pop || true

# Step 7: Add base branch links to .lycheeignore
- name: Update ignore file
run: |
if [ -f "existing-links.txt" ]; then
cat existing-links.txt >> .lycheeignore
fi

# Step 8: Run Lychee on changed files one by one
- name: Run Lychee link checker
run: |
for f in ${{ env.changed_files }}; do
echo "Checking links in $f"
lychee --no-progress --include-fragments "$f"
done

# Step 9: Provide a helpful failure message
- name: Helpful failure message
if: ${{ failure() }}
run: |
echo "::error::Link check failed! Please review the broken links reported above."
echo ""
echo "If certain links are valid but fail due to:"
echo "- CAPTCHA challenges"
echo "- IP blocking"
echo "- Authentication requirements"
echo "- Rate limiting"
echo ""
echo "Consider adding them to .lycheeignore to bypass future checks."
echo "Format: Add one URL pattern per line"
exit 1
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@
*.orig
.vscode
.idea
.lycheecache
32 changes: 32 additions & 0 deletions .lycheeignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# These links are ignored by lychee link checker: https://github.com/lycheeverse/lychee
# The file allows you to list multiple regular expressions for exclusion (one pattern per line).
# The `.lycheeignore` file is only used for excluding URLs, not paths. Use the `exclude_path` key in the `lychee.toml` file. ref: https://lychee.cli.rs/recipes/excluding-paths/

# GitHub blob/tree fragment links
^https://github\.com/umbraco/Umbraco-CMS/blob/.*/.*#L.*
^https://github\.com/umbraco/Umbraco-CMS/tree/.*
^https://github\.com/Shazwazza/Articulate/blob/.*/.*#L.*
^https://github\.com/umbraco/Umbraco-CMS/blob/.*

# Anchor/fragment links causing false positives
^https://docs\.umbraco\.com/.*/#.*
^https://apidocs\.umbraco\.com/.*/#.*
^https://tinymce\.github\.io/.*/#.*
^https://openid\.net/.*/#.*
^https://docs\.microsoft\.com/.*#.*
^https://learn\.microsoft\.com/.*#.*
^https://developer\.mozilla\.org/.*/#.*
^https://learning\.postman\.com/docs/.*/#.*
^https://nginx\.org/.*/#.*
^https://azure\.microsoft\.com/en-gb/services/media-services/.*
^https://www\.tiny\.cloud/docs/.*

# TinyMCE anchors
^https://github\.com/tinymce/tinymce/issues/.*#.*

# NIST FIPS and other static docs
^https://csrc\.nist\.gov/publications/PubsFIPS\.html#.*

# Timeout-prone Umbraco issue links
^https://issues\.umbraco\.org/issue/.*
^https://issues\.umbraco\.org/issues/.*
2 changes: 1 addition & 1 deletion 16/umbraco-cms/fundamentals/code/source-control.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ description: >-

## Umbraco Cloud

When you are running your site on Umbraco Cloud, source control is a part of the experience. Have a look at the ['Technical overview of an Umbraco Cloud Environment'](https://docs.umbraco.com/umbraco-cloud/getting-started/environments) and the information on ['Working with your Umbraco Cloud project'](https://docs.umbraco.com/umbraco-cloud/setup/set-up#working-with-your-umbraco-cloud-project) for a steer on Source/Version Control good practices.
When you are running your site on Umbraco Cloud, source control is a part of the experience. Have a look at the ['Technical overview of an Umbraco Cloud Environment'](https://docs.umbraco.com/umbraco-cloud/getting-started/environments). Additionally, look at ['Working with a Local Clone'](https://docs.umbraco.com/umbraco-cloud/build-and-customize-your-solution/handle-deployments-and-environments/working-locally) for a steer on Source/Version Control good practices.

## Outside of Umbraco Cloud

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ A video tutorial guiding you through the steps of upgrading from version 8 to th
If you use Umbraco Forms, make sure to have [`StoreUmbracoFormsInDbset`](https://docs.umbraco.com/umbraco-forms/developer/forms-in-the-database#enable-storing-forms-definitions-in-the-database)to `True` before **step 1**.
{% endhint %}

1. Create a backup of the database from your Umbraco 8 project (after you have upgraded to the latest version of v8). For this, you can use the [database backup guide](https://docs.umbraco.com/umbraco-cloud/databases/backups#backup-with-sql-server-management-studio).
1. Create a backup of the database from your Umbraco 8 project (after you have upgraded to the latest version of v8). For this, you can use the [Database backups Guide](https://docs.umbraco.com/umbraco-cloud/build-and-customize-your-solution/set-up-your-project/databases/backups#restoring-a-cloud-backup-to-a-sql-server-database).
2. Import the database backup into SQL Server Management Studio.
3. Update the connection string in the new projects `appsettings.json` file so that it connects to the Umbraco 8 database:

Expand Down
Loading