Skip to content

Commit

Permalink
Merge branch 'main' into en-add-labels-gittea
Browse files Browse the repository at this point in the history
  • Loading branch information
marcoieni authored Jan 7, 2025
2 parents 503b8ab + bcd1411 commit eb29ba2
Show file tree
Hide file tree
Showing 2 changed files with 68 additions and 1 deletion.
9 changes: 8 additions & 1 deletion .github/workflows/links.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@ on:
push:
branches:
- main
pull_request:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
linkChecker:
Expand All @@ -18,3 +21,7 @@ jobs:
uses: lycheeverse/lychee-action@f796c8b7d468feb9b8c0a46da3fac0af6874d374 # v2.2.0
with:
fail: true
args: |
--no-progress
--include-fragments
.
60 changes: 60 additions & 0 deletions .github/workflows/pr-links.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# Check links that changed in the pull request
name: PR Links

on:
pull_request:
branches:
- main

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
check-links:
runs-on: ubuntu-24.04

steps:
- name: Clone repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 0
ref: ${{github.event.pull_request.head.ref}}
repository: ${{github.event.pull_request.head.repo.full_name}}

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

- name: Dump all links from ${{github.event.pull_request.base.ref}}
uses: lycheeverse/lychee-action@f796c8b7d468feb9b8c0a46da3fac0af6874d374 # v2.2.0
with:
args: |
--dump
--include-fragments
.
output: ./existing-links.txt
continue-on-error: true # Don't fail if base branch check has issues

- 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

- name: Update ignore file
run: |
if [ -f "existing-links.txt" ]; then
cat existing-links.txt >> .lycheeignore
fi
- name: Check links
uses: lycheeverse/lychee-action@f796c8b7d468feb9b8c0a46da3fac0af6874d374 # v2.2.0
with:
fail: true
args: |
--no-progress
--include-fragments
.

0 comments on commit eb29ba2

Please sign in to comment.