From 11cd1dc9afb4c351f4bab042e42941fb7a86fd20 Mon Sep 17 00:00:00 2001 From: Dan Jaglowski Date: Wed, 22 Jun 2022 12:26:51 -0400 Subject: [PATCH 1/2] [check-links] Diff against common ancestor with origin/main --- .github/workflows/check-links.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/check-links.yaml b/.github/workflows/check-links.yaml index 13491a4227d4..ef37b7de2d17 100644 --- a/.github/workflows/check-links.yaml +++ b/.github/workflows/check-links.yaml @@ -19,7 +19,7 @@ jobs: - name: Get changed files id: changes run: | - echo "::set-output name=md::$(git diff --name-only --diff-filter=ACMRTUXB origin/${{ github.event.pull_request.base.ref }} ${{ github.event.pull_request.head.sha }} | grep .md$ | xargs)" + echo "::set-output name=md::$(git diff --name-only --diff-filter=ACMRTUXB $(git merge-base origin/main HEAD) ${{ github.event.pull_request.head.sha }} | grep .md$ | xargs)" check-links: runs-on: ubuntu-latest needs: changedfiles From 0229c658ac46c5eacded51641b280d034ad79b9b Mon Sep 17 00:00:00 2001 From: Dan Jaglowski Date: Wed, 22 Jun 2022 12:47:22 -0400 Subject: [PATCH 2/2] Use github variable instead of HEAD --- .github/workflows/check-links.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/check-links.yaml b/.github/workflows/check-links.yaml index ef37b7de2d17..cf4ffd88ad9d 100644 --- a/.github/workflows/check-links.yaml +++ b/.github/workflows/check-links.yaml @@ -19,7 +19,7 @@ jobs: - name: Get changed files id: changes run: | - echo "::set-output name=md::$(git diff --name-only --diff-filter=ACMRTUXB $(git merge-base origin/main HEAD) ${{ github.event.pull_request.head.sha }} | grep .md$ | xargs)" + echo "::set-output name=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)" check-links: runs-on: ubuntu-latest needs: changedfiles