Diff for merge_group (#30948)
Co-authored-by: Hector Alfaro <hectorsector@github.com>
This commit is contained in:
8
.github/workflows/link-check-all.yml
vendored
8
.github/workflows/link-check-all.yml
vendored
@@ -28,6 +28,9 @@ jobs:
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@dcd71f646680f2efd8db4afa5ad64fdcba30e748
|
||||
# Get the branches so merge_group can make the comparison with git diff
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Setup node
|
||||
uses: actions/setup-node@17f8bd926464a1afa4c6a11669539e9c1ba77048
|
||||
@@ -43,7 +46,6 @@ jobs:
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
PR: ${{ github.event.pull_request.number }}
|
||||
BASE: ${{ github.event.pull_request.base.ref || github.event.merge_group.base_ref }}
|
||||
HEAD: ${{ github.event.pull_request.head.ref || github.event.merge_group.head_ref }}
|
||||
run: |
|
||||
# If its a pull request, use the faster call to the GitHub API
|
||||
@@ -51,9 +53,9 @@ jobs:
|
||||
if [ -n "$PR" ]
|
||||
then
|
||||
DIFF=`gh pr diff $PR --name-only`
|
||||
elif [ -n "$BASE" ] && [ -n "$HEAD" ]
|
||||
elif [ -n "$HEAD" ]
|
||||
then
|
||||
DIFF=`git diff --name-only $BASE $HEAD`
|
||||
DIFF=`git diff --name-only origin/main`
|
||||
else
|
||||
DIFF=''
|
||||
fi
|
||||
|
||||
7
.github/workflows/test.yml
vendored
7
.github/workflows/test.yml
vendored
@@ -74,6 +74,8 @@ jobs:
|
||||
lfs: ${{ matrix.test-group == 'content' }}
|
||||
# Enables cloning the Early Access repo later with the relevant PAT
|
||||
persist-credentials: 'false'
|
||||
# Get the branches so merge_group can make the comparison with git diff
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Figure out which docs-early-access branch to checkout, if internal repo
|
||||
if: ${{ github.repository == 'github/docs-internal' }}
|
||||
@@ -131,7 +133,6 @@ jobs:
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
PR: ${{ github.event.pull_request.number }}
|
||||
BASE: ${{ github.event.pull_request.base.ref || github.event.merge_group.base_ref }}
|
||||
HEAD: ${{ github.event.pull_request.head.ref || github.event.merge_group.head_ref }}
|
||||
run: |
|
||||
# If its a pull request, use the faster call to the GitHub API
|
||||
@@ -139,9 +140,9 @@ jobs:
|
||||
if [ -n "$PR" ]
|
||||
then
|
||||
DIFF=`gh pr diff $PR --name-only`
|
||||
elif [ -n "$BASE" ] && [ -n "$HEAD" ]
|
||||
elif [ -n "$HEAD" ]
|
||||
then
|
||||
DIFF=`git diff --name-only $BASE $HEAD`
|
||||
DIFF=`git diff --name-only origin/main`
|
||||
else
|
||||
DIFF=''
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user