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
Fix markdown-fail-fast Get Changes
step script (#7045)
This has been failing silently: https://github.com/open-telemetry/opentelemetry-go/actions/runs/16361094932/job/46229000882 - Fix the variable handling - Add debugging `echo`s - Reduce permissions to minimum needed
This commit is contained in:
34
.github/workflows/markdown-fail-fast.yml
vendored
34
.github/workflows/markdown-fail-fast.yml
vendored
@@ -4,8 +4,8 @@ on:
|
|||||||
push:
|
push:
|
||||||
pull_request:
|
pull_request:
|
||||||
|
|
||||||
# Declare default permissions as read only.
|
permissions:
|
||||||
permissions: read-all
|
contents: read
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
changedfiles:
|
changedfiles:
|
||||||
@@ -20,8 +20,24 @@ jobs:
|
|||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
- name: Get changed files
|
- name: Get changed files
|
||||||
id: changes
|
id: changes
|
||||||
|
env:
|
||||||
|
PR_HEAD_SHA: ${{ github.event.pull_request.head.sha }}
|
||||||
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
echo "md=$(git diff --name-only --diff-filter=ACMRTUXB origin/${{ github.event.pull_request.base.ref }} ${{ github.event.pull_request.head.sha }} | grep .md$ | xargs)" >> $GITHUB_OUTPUT
|
echo "PR_HEAD_SHA=$PR_HEAD_SHA"
|
||||||
|
|
||||||
|
base="$(git merge-base origin/main $PR_HEAD_SHA)"
|
||||||
|
echo "BASE_REF=$base"
|
||||||
|
|
||||||
|
changed="$(git diff --name-only --diff-filter=ACMRTUXB $base $PR_HEAD_SHA)"
|
||||||
|
echo "CHANGED=$changed"
|
||||||
|
|
||||||
|
filtered="$(grep '.md$' <<<"$changed" || true)"
|
||||||
|
echo "filtered=$filtered"
|
||||||
|
|
||||||
|
md="$(echo $filtered | xargs -d '\n' echo)"
|
||||||
|
echo "md=$md"
|
||||||
|
echo "md=$md" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
lint:
|
lint:
|
||||||
name: lint markdown files
|
name: lint markdown files
|
||||||
@@ -29,9 +45,9 @@ jobs:
|
|||||||
needs: changedfiles
|
needs: changedfiles
|
||||||
if: ${{needs.changedfiles.outputs.md}}
|
if: ${{needs.changedfiles.outputs.md}}
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout Repo
|
- name: Checkout Repo
|
||||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||||
- name: Run linter
|
- name: Run linter
|
||||||
uses: docker://avtodev/markdown-lint:v1@sha256:6aeedc2f49138ce7a1cd0adffc1b1c0321b841dc2102408967d9301c031949ee
|
uses: docker://avtodev/markdown-lint:v1@sha256:6aeedc2f49138ce7a1cd0adffc1b1c0321b841dc2102408967d9301c031949ee
|
||||||
with:
|
with:
|
||||||
args: ${{needs.changedfiles.outputs.md}}
|
args: ${{needs.changedfiles.outputs.md}}
|
||||||
|
Reference in New Issue
Block a user