Adding the condition to fix push vs pull_request_target commit checkouts

This commit is contained in:
Arpit Mohan 2020-10-07 06:37:49 +05:30
parent bf2b4efbfd
commit 0c4b437d98

View File

@ -24,10 +24,16 @@ jobs:
steps:
# Checkout the code
- uses: actions/checkout@v2
- name: Checkout the merged commit from PR and base branch
if: ${{ github.event_name == 'pull_request_target' }}
uses: actions/checkout@v2
with:
ref: refs/pull/${{ github.event.pull_request.number }}/merge
- name: Checkout the head commit of the branch
if: ${{ github.event_name == 'push' }}
uses: actions/checkout@v2
- name: Figure out the PR number
run: echo ${{ github.event.pull_request.number }}
@ -103,10 +109,16 @@ jobs:
steps:
# Checkout the code
- uses: actions/checkout@v2
- name: Checkout the merged commit from PR and base branch
if: ${{ github.event_name == 'pull_request_target' }}
uses: actions/checkout@v2
with:
ref: refs/pull/${{ github.event.pull_request.number }}/merge
- name: Checkout the head commit of the branch
if: ${{ github.event_name == 'push' }}
uses: actions/checkout@v2
- name: Use Node.js 10.16.3
uses: actions/setup-node@v1
with:
@ -208,9 +220,15 @@ jobs:
steps:
# Checkout the code
- uses: actions/checkout@v2
- name: Checkout the merged commit from PR and base branch
if: ${{ github.event_name == 'pull_request_target' }}
uses: actions/checkout@v2
with:
ref: refs/pull/${{ github.event.pull_request.number }}/merge
- name: Checkout the head commit of the branch
if: ${{ github.event_name == 'push' }}
uses: actions/checkout@v2
- name: Download the react build artifact
uses: actions/download-artifact@v2