Skip to content

Commit 3a65310

Browse files
authored
Fix lychee (#2345)
1 parent 50d579d commit 3a65310

File tree

3 files changed

+7
-11
lines changed

3 files changed

+7
-11
lines changed

.github/workflows/build-daily.yml

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,7 @@ jobs:
1616
no-build-cache: true
1717

1818
link-check:
19-
runs-on: ubuntu-latest
20-
steps:
21-
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
22-
23-
- uses: jdx/mise-action@e3d7b8d67a7958d1207f6ed871e83b1ea780e7b0 # v3.3.1
24-
25-
- run: mise run lint:links
26-
env:
27-
GITHUB_TOKEN: ${{ github.token }}
19+
uses: ./.github/workflows/reusable-link-check.yml
2820

2921
workflow-notification:
3022
permissions:

.github/workflows/reusable-link-check.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,4 @@ jobs:
2424
- name: Link check (modified files only)
2525
env:
2626
GITHUB_TOKEN: ${{ github.token }}
27-
run: mise run lint:links-in-modified-files --base origin/${{ github.base_ref }} --head ${{ github.event.pull_request.head.sha }}
27+
run: mise run lint:links-in-modified-files --base origin/${{ github.base_ref }} --head ${{ github.event.pull_request.head.sha }} --event ${{ github.event_name }}

.mise/tasks/lint/links-in-modified-files.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ set -e
55

66
#USAGE flag "--base <base>" help="base branch to compare against (default: origin/main)" default="origin/main"
77
#USAGE flag "--head <head>" help="head branch to compare against (empty for local changes) (default: empty)" default=""
8+
#USAGE flag "--event <event>" help="event name (default: pull_request)" default="pull_request"
89

910
if [ "$usage_head" = "''" ]; then
1011
usage_head=""
@@ -16,7 +17,10 @@ fi
1617
config_modified=$(git diff --name-only --merge-base "$usage_base" $usage_head \
1718
| grep -E '^(\.github/config/lychee\.toml|\.mise/tasks/lint/.*|mise\.toml)$' || true)
1819

19-
if [ -n "$config_modified" ] ; then
20+
if [ "$usage_event" != "pull_request" ] ; then
21+
echo "Not a PR - checking all files."
22+
mise run lint:links
23+
elif [ -n "$config_modified" ] ; then
2024
echo "config changes, checking all files."
2125
mise run lint:links
2226
else

0 commit comments

Comments
 (0)