Skip to content

Commit 4129314

Browse files
authored
Use root-dir instead of base-url in CI (#111)
* Use root-dir instead of base-url in CI root-dir is the right argument to use to check a directory of local files. * as above, for check-links.yml * we want to checkout the merge ref in a pr * we need to fetch the ref first because it isn't a normal branch
1 parent 2833525 commit 4129314

File tree

2 files changed

+4
-9
lines changed

2 files changed

+4
-9
lines changed

.github/workflows/check-links.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,5 @@ jobs:
2323
id: lychee
2424
uses: lycheeverse/lychee-action@v2
2525
with:
26-
args: --base-url dist --exclude-all-private dist
26+
args: '--root-dir ${{ github.workspace }}/dist --exclude-all-private dist'
2727
fail: false

.github/workflows/check-pr-links.yml

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -37,19 +37,14 @@ jobs:
3737
id: dump_links_from_master
3838
uses: lycheeverse/lychee-action@v2
3939
with:
40-
args: --dump --base-url dist --exclude-all-private dist
40+
args: '--dump --root-dir ${{ github.workspace }}/dist --exclude-all-private dist'
4141
output: ./links-master.txt
4242

4343
- name: Stash untracked files
4444
run: git stash push --include-untracked
4545

4646
- name: Check out feature branch
47-
run: |
48-
if [ "${{ github.event_name }}" = "pull_request" ]; then
49-
git checkout ${{ github.head_ref }}
50-
else
51-
git checkout ${{ github.ref_name }}
52-
fi
47+
run: git fetch origin ${{ github.ref }} && git checkout FETCH_HEAD
5348

5449
- name: Apply stashed changes
5550
run: git stash pop || true
@@ -66,7 +61,7 @@ jobs:
6661
- name: Check links in PR changes
6762
uses: lycheeverse/lychee-action@v2
6863
with:
69-
args: --base-url dist --exclude-all-private dist
64+
args: '--root-dir ${{ github.workspace }}/dist --exclude-all-private dist'
7065
fail: true
7166

7267
- name: Suggestions

0 commit comments

Comments
 (0)