1
0
mirror of synced 2025-12-30 03:01:36 -05:00

Diff for merge_group (#30948)

Co-authored-by: Hector Alfaro <hectorsector@github.com>
This commit is contained in:
Kevin Heis
2022-09-19 14:32:01 -07:00
committed by GitHub
parent dcb20c547f
commit f11af9cb33
2 changed files with 9 additions and 6 deletions

View File

@@ -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

View File

@@ -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