From 3561044b5fbeb1c3bfffa14fa752362488329cc0 Mon Sep 17 00:00:00 2001 From: Chintan Kavathia Date: Tue, 3 Dec 2024 10:34:20 +0530 Subject: [PATCH] ci: use diff url for lfs --- .github/workflows/test_and_deploy.yml | 35 +++------------------------ 1 file changed, 4 insertions(+), 31 deletions(-) diff --git a/.github/workflows/test_and_deploy.yml b/.github/workflows/test_and_deploy.yml index 226515329..6765d3335 100644 --- a/.github/workflows/test_and_deploy.yml +++ b/.github/workflows/test_and_deploy.yml @@ -14,38 +14,11 @@ jobs: with: node-version: lts/iron - - name: Set the branch name - id: set_branch - run: | - BRANCH_NAME=${{ github.head_ref }} - echo "Branch name is: $BRANCH_NAME" - - # Check for remote branch - REMOTE_BRANCH=$(git ls-remote --heads https://$SNAPSHOT_REPO_TOKEN@github.com/chintankavathia/ngx-datatable-snapshots.git $BRANCH_NAME) - - echo "Remote branch lookup result: $REMOTE_BRANCH" - - if [ -n "$REMOTE_BRANCH" ]; then - echo "Branch $BRANCH_NAME exists" - echo "branch=$BRANCH_NAME" >> $GITHUB_ENV - else - echo "Branch $BRANCH_NAME does not exist, defaulting to main" - echo "branch=main" >> $GITHUB_ENV - fi + - name: Configure LFS Fetch URL + run: git config remote.origin.lfsurl https://github.com/chintankavathia/ngx-datatable-snapshots.git/info/lfs - - name: Clone Snapshot Repository - run: | - git clone https://$SNAPSHOT_REPO_TOKEN@github.com/chintankavathia/ngx-datatable-snapshots.git temp_snapshots - cd temp_snapshots - git checkout ${{ env.branch }} - env: - SNAPSHOT_REPO_TOKEN: ${{ secrets.SNAPSHOT_REPO_TOKEN }} - - - name: Copy Snapshots to Playwright Folder - run: | - mkdir -p playwright/snapshots - cp -r temp_snapshots/snapshots/e2e playwright/snapshots/ - rm -rf temp_snapshots + - name: Pull Repository with LFS + run: git lfs pull - name: Install uses: bahmutov/npm-install@v1