From 593121e5a74ab9f5642610d4811cac16c20fde17 Mon Sep 17 00:00:00 2001 From: Refringe Date: Thu, 25 Apr 2024 01:27:52 -0400 Subject: [PATCH] Workflow: Try using the branch for pushes, and sha for PRs --- .gitea/workflows/run-test.yaml | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/.gitea/workflows/run-test.yaml b/.gitea/workflows/run-test.yaml index 24f5deb7..c735e7e7 100644 --- a/.gitea/workflows/run-test.yaml +++ b/.gitea/workflows/run-test.yaml @@ -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