From 90b80960533f72b82d556cd42b8cc75f8bfd701d Mon Sep 17 00:00:00 2001 From: yuxuanj Date: Wed, 24 Jun 2026 14:49:53 -0700 Subject: [PATCH 1/4] skipped deleted files in PR --- .github/workflows/validate-pr.yml | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/.github/workflows/validate-pr.yml b/.github/workflows/validate-pr.yml index 8a3368b..95a5771 100644 --- a/.github/workflows/validate-pr.yml +++ b/.github/workflows/validate-pr.yml @@ -58,10 +58,28 @@ jobs: with: fetch-depth: 0 + - name: Get changed non-deleted markdown files + id: changed-files + env: + BASE_REF: ${{ inputs.base_ref }} + run: | + git fetch origin "$BASE_REF" + FILES=$(git diff --diff-filter=d --name-only "origin/${BASE_REF}...HEAD" \ + | grep '^src/pages/.*\.md$' || true) + echo "files<> $GITHUB_OUTPUT + echo "$FILES" >> $GITHUB_OUTPUT + echo "EOF" >> $GITHUB_OUTPUT + - name: Lint id: lint continue-on-error: true - run: npx --yes github:AdobeDocs/adp-devsite-utils runLint -v + run: | + FILES="${{ steps.changed-files.outputs.files }}" + if [ -z "$FILES" ]; then + echo "No markdown files to lint" + exit 0 + fi + npx --yes github:AdobeDocs/adp-devsite-utils runLint -v $FILES - name: Save PR number if: always() From 276d4f78da667bd5c2066f46b60afb7f4748da73 Mon Sep 17 00:00:00 2001 From: yuxuanj Date: Wed, 24 Jun 2026 14:51:28 -0700 Subject: [PATCH 2/4] fix: skip deleted files in lint-v3 changed-file filter Co-Authored-By: Claude Sonnet 4.6 --- .github/workflows/lint-v3.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/lint-v3.yml b/.github/workflows/lint-v3.yml index d98f696..5ce4fc4 100644 --- a/.github/workflows/lint-v3.yml +++ b/.github/workflows/lint-v3.yml @@ -63,7 +63,7 @@ jobs: env: BASE_REF: ${{ inputs.base_ref }} run: | - CHANGED_MD=$(git diff --name-only "origin/${BASE_REF}...HEAD" | grep "^src/pages/.*\.md$" | tr '\n' ' ') + CHANGED_MD=$(git diff --diff-filter=d --name-only "origin/${BASE_REF}...HEAD" | grep "^src/pages/.*\.md$" | tr '\n' ' ') npx --yes github:AdobeDocs/adp-devsite-utils#DEVSITE-2442 runLint -v $CHANGED_MD - name: Save PR number From e7958216271586d0ebc7ce7c6e33d86b0036fadb Mon Sep 17 00:00:00 2001 From: yuxuanj Date: Wed, 24 Jun 2026 14:57:05 -0700 Subject: [PATCH 3/4] Revert "skipped deleted files in PR" This reverts commit 90b80960533f72b82d556cd42b8cc75f8bfd701d. --- .github/workflows/validate-pr.yml | 20 +------------------- 1 file changed, 1 insertion(+), 19 deletions(-) diff --git a/.github/workflows/validate-pr.yml b/.github/workflows/validate-pr.yml index 95a5771..8a3368b 100644 --- a/.github/workflows/validate-pr.yml +++ b/.github/workflows/validate-pr.yml @@ -58,28 +58,10 @@ jobs: with: fetch-depth: 0 - - name: Get changed non-deleted markdown files - id: changed-files - env: - BASE_REF: ${{ inputs.base_ref }} - run: | - git fetch origin "$BASE_REF" - FILES=$(git diff --diff-filter=d --name-only "origin/${BASE_REF}...HEAD" \ - | grep '^src/pages/.*\.md$' || true) - echo "files<> $GITHUB_OUTPUT - echo "$FILES" >> $GITHUB_OUTPUT - echo "EOF" >> $GITHUB_OUTPUT - - name: Lint id: lint continue-on-error: true - run: | - FILES="${{ steps.changed-files.outputs.files }}" - if [ -z "$FILES" ]; then - echo "No markdown files to lint" - exit 0 - fi - npx --yes github:AdobeDocs/adp-devsite-utils runLint -v $FILES + run: npx --yes github:AdobeDocs/adp-devsite-utils runLint -v - name: Save PR number if: always() From befb6a2952cd6ac19cdd1d4783431e2f4b3d5d4b Mon Sep 17 00:00:00 2001 From: yuxuanj Date: Thu, 25 Jun 2026 15:21:24 -0700 Subject: [PATCH 4/4] fix: exclude deleted files from src/pages change detection Pure-delete PRs set run_lint=true because the filter step used plain --name-only. The Lint step already uses --diff-filter=d so CHANGED_MD ends up empty, causing a pipefail. Apply --diff-filter=d in the filter step too so delete-only PRs are treated the same as no-src/pages-change PRs. Co-Authored-By: Claude Sonnet 4.6 --- .github/workflows/lint-v3.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/lint-v3.yml b/.github/workflows/lint-v3.yml index 5ce4fc4..eab3ec5 100644 --- a/.github/workflows/lint-v3.yml +++ b/.github/workflows/lint-v3.yml @@ -35,7 +35,7 @@ jobs: BASE_REF: ${{ inputs.base_ref }} run: | git fetch origin "$BASE_REF" - CHANGED_FILES=$(git diff --name-only "origin/${BASE_REF}...HEAD") + CHANGED_FILES=$(git diff --diff-filter=d --name-only "origin/${BASE_REF}...HEAD") if echo "$CHANGED_FILES" | grep -q "^src/pages/"; then echo "run_lint=true" >> $GITHUB_OUTPUT echo "✅ Changes detected in src/pages/"