fix(ci): support fork pr in ci (#52)
This commit is contained in:
@@ -59,8 +59,9 @@ jobs:
|
||||
git config --global --add safe.directory "$CLEAN_WORKSPACE"
|
||||
git clone --recursive "https://x-access-token:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git" .
|
||||
|
||||
if [ -n "${{ github.event.pull_request.head.sha }}" ]; then
|
||||
git checkout "${{ github.event.pull_request.head.sha }}"
|
||||
if [ -n "${{ github.event.number }}" ]; then
|
||||
git fetch origin "pull/${{ github.event.number }}/head"
|
||||
git checkout FETCH_HEAD
|
||||
else
|
||||
git checkout "${{ github.sha }}"
|
||||
fi
|
||||
|
||||
@@ -62,8 +62,9 @@ jobs:
|
||||
git config --global --add safe.directory "$CLEAN_WORKSPACE"
|
||||
git clone --recursive "https://x-access-token:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git" .
|
||||
|
||||
if [ -n "${{ github.event.pull_request.head.sha }}" ]; then
|
||||
git checkout "${{ github.event.pull_request.head.sha }}"
|
||||
if [ -n "${{ github.event.number }}" ]; then
|
||||
git fetch origin "pull/${{ github.event.number }}/head"
|
||||
git checkout FETCH_HEAD
|
||||
else
|
||||
git checkout "${{ github.sha }}"
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user