diff --git a/.github/workflows/check-links.yml b/.github/workflows/check-links.yml index aadb6d5651..a353a1a74f 100644 --- a/.github/workflows/check-links.yml +++ b/.github/workflows/check-links.yml @@ -3,45 +3,45 @@ on: push: branches: [ main ] pull_request: + paths: + - '**/*.md' + - '.github/workflows/check-links.yml' + - '.github/workflows/check_links_config.json' permissions: contents: read +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_id }} + cancel-in-progress: true + jobs: - changedfiles: - name: changed files - runs-on: ubuntu-latest - if: ${{ github.actor != 'dependabot[bot]' }} - outputs: - md: ${{ steps.changes.outputs.md }} - steps: - - name: Checkout Repo - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - name: Get changed files - id: changes - run: | - echo "md=$(git diff --name-only --diff-filter=ACMRTUXB $(git merge-base origin/main ${{ github.event.pull_request.head.sha }}) ${{ github.event.pull_request.head.sha }} | grep .md$ | xargs)" >> $GITHUB_OUTPUT check-links: runs-on: ubuntu-latest - needs: changedfiles - if: | - github.event.pull_request.user.login != 'otelbot[bot]' && github.event_name == 'pull_request' - && ${{needs.changedfiles.outputs.md}} + timeout-minutes: 15 + if: ${{ github.actor != 'dependabot[bot]' && github.actor != 'otelbot[bot]' }} steps: - name: Checkout Repo - uses: actions/checkout@v4 + uses: actions/checkout@v6 with: fetch-depth: 0 + - name: Get changed markdown files + id: changed-files + uses: tj-actions/changed-files@v46 + with: + files: | + **/*.md + - name: Install markdown-link-check + if: steps.changed-files.outputs.any_changed == 'true' run: npm install -g markdown-link-check@v3.12.2 - name: Run markdown-link-check + if: steps.changed-files.outputs.any_changed == 'true' run: | markdown-link-check \ --verbose \ --config .github/workflows/check_links_config.json \ - ${{needs.changedfiles.outputs.md}} \ + ${{ steps.changed-files.outputs.all_changed_files }} \ || { echo "Check that anchor links are lowercase"; exit 1; } diff --git a/CHANGELOG.md b/CHANGELOG.md index 9130b34475..4be09fa75a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,6 +22,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ([#4935](https://github.com/open-telemetry/opentelemetry-python/pull/4935)) - `opentelemetry-sdk`: upgrade vendored OTel configuration schema from v1.0.0-rc.3 to v1.0.0 ([#4965](https://github.com/open-telemetry/opentelemetry-python/pull/4965)) +- improve check-links ci job + ([#4965](https://github.com/open-telemetry/opentelemetry-python/pull/4965)) ## Version 1.40.0/0.61b0 (2026-03-04)