Workflow: Try using the branch for pushes, and sha for PRs

This commit is contained in:
Refringe 2024-04-25 01:27:52 -04:00
parent ea0b4bdeed
commit 593121e5a7
No known key found for this signature in database
GPG Key ID: 7715B85B4A6306ED

View File

@ -17,8 +17,23 @@ jobs:
steps:
- name: Clone
run: |
# For pull request events, checkout using GITHUB_SHA
# For push events, checkout using GITHUB_REF_NAME
if [[ $GITHUB_EVENT_NAME == "pull_request" ]]; then
REF=${GITHUB_SHA}
else
REF=${GITHUB_REF_NAME}
fi
rm -rf ${{ github.workspace }}/current
git clone --progress https://dev.sp-tarkov.com/${{ github.repository }}.git --branch ${{ github.ref }} ${{ github.workspace }}/current
git clone https://dev.sp-tarkov.com/${{ github.repository }}.git ${{ github.workspace }}/current
cd ${{ github.workspace }}/current
git checkout $REF
env:
GITHUB_SHA: ${{ github.sha }}
GITHUB_REF_NAME: ${{ github.ref_name }}
GITHUB_EVENT_NAME: ${{ github.event_name }}
shell: bash
- name: Pull LFS Files