Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions .github/workflows/publish-blog-draft.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ jobs:
- uses: actions/checkout@v4
with:
ref: main
fetch-depth: 0 # full history so base.sha is present for the draft diff
token: ${{ secrets.GITHUB_TOKEN }}

- uses: actions/setup-node@v4
Expand All @@ -27,8 +28,12 @@ jobs:
- name: Find draft files merged by this PR
id: find_drafts
run: |
git fetch origin ${{ github.event.pull_request.head.sha }} --depth=2
FILES=$(git diff --name-only ${{ github.event.pull_request.base.sha }} ${{ github.event.pull_request.head.sha }} \
BASE='${{ github.event.pull_request.base.sha }}'
HEAD='${{ github.event.pull_request.head.sha }}'
# fetch-depth:0 gives BASE via main history; fetch HEAD explicitly in case
# of a squash-merge where the PR head commit isn't reachable from main.
git fetch --no-tags origin "$HEAD" 2>/dev/null || true
FILES=$(git diff --name-only --diff-filter=AM "$BASE" "$HEAD" 2>/dev/null \
| grep '^docs/content-pipeline/drafts/.*\.md$' || true)
echo "drafts<<EOF" >> $GITHUB_OUTPUT
echo "$FILES" >> $GITHUB_OUTPUT
Expand Down