1
0
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:
Tyler Yahn
2025-06-06 01:52:21 -07:00
committed by GitHub
parent 3d02ee7886
commit 82397b219b

View File

@@ -10,8 +10,32 @@ on:
permissions: read-all permissions: read-all
jobs: 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: check-links:
runs-on: ubuntu-latest runs-on: ubuntu-latest
needs: changedfiles
if: ${{needs.changedfiles.outputs.files}}
permissions: permissions:
contents: read contents: read
steps: steps:
@@ -31,7 +55,8 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with: with:
fail: true 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 - name: Save lychee cache
if: always() if: always()