You've already forked opentelemetry-go
mirror of
https://github.com/open-telemetry/opentelemetry-go.git
synced 2025-08-10 22:31:50 +02:00
Only check links in changed files for fail-fast workflow (#6850)
Fix #6573 Co-authored-by: Damien Mathieu <42@dmathieu.com>
This commit is contained in:
27
.github/workflows/links-fail-fast.yml
vendored
27
.github/workflows/links-fail-fast.yml
vendored
@@ -10,8 +10,32 @@ on:
|
||||
permissions: read-all
|
||||
|
||||
jobs:
|
||||
changedfiles:
|
||||
name: changed files
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
PR_HEAD: ${{ github.event.pull_request.head.sha }}
|
||||
outputs:
|
||||
files: ${{ steps.changes.outputs.files }}
|
||||
steps:
|
||||
- name: Checkout Repo
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: Get changed files
|
||||
id: changes
|
||||
run: |
|
||||
files=$(git diff --name-only --diff-filter=ACMRTUXB $(git merge-base origin/main $PR_HEAD) $PR_HEAD | xargs)
|
||||
|
||||
# Used for debugging.
|
||||
echo "files=$files"
|
||||
|
||||
echo "files=$files" >> $GITHUB_OUTPUT
|
||||
|
||||
check-links:
|
||||
runs-on: ubuntu-latest
|
||||
needs: changedfiles
|
||||
if: ${{needs.changedfiles.outputs.files}}
|
||||
permissions:
|
||||
contents: read
|
||||
steps:
|
||||
@@ -31,7 +55,8 @@ jobs:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
with:
|
||||
fail: true
|
||||
args: --max-concurrency 5 --cache --max-cache-age 1d --cache-exclude-status 300..=599 .
|
||||
failIfEmpty: false
|
||||
args: --max-concurrency 5 --cache --max-cache-age 1d --cache-exclude-status 300..=599 ${{needs.changedfiles.outputs.files}}
|
||||
|
||||
- name: Save lychee cache
|
||||
if: always()
|
||||
|
Reference in New Issue
Block a user