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:
22
.github/workflows/markdown-fail-fast.yml
vendored
22
.github/workflows/markdown-fail-fast.yml
vendored
@@ -4,8 +4,8 @@ on:
|
||||
push:
|
||||
pull_request:
|
||||
|
||||
# Declare default permissions as read only.
|
||||
permissions: read-all
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
changedfiles:
|
||||
@@ -20,8 +20,24 @@ jobs:
|
||||
fetch-depth: 0
|
||||
- name: Get changed files
|
||||
id: changes
|
||||
env:
|
||||
PR_HEAD_SHA: ${{ github.event.pull_request.head.sha }}
|
||||
shell: bash
|
||||
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:
|
||||
name: lint markdown files
|
||||
|
Reference in New Issue
Block a user