Skip to content

Commit

Permalink
removes the existing origin remote if it exists
Browse files Browse the repository at this point in the history
  • Loading branch information
SubhedarV authored Sep 16, 2024
1 parent 1421824 commit 2102da7
Showing 1 changed file with 13 additions and 11 deletions.
24 changes: 13 additions & 11 deletions .github/workflows/tarrr_file.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,17 +47,19 @@ jobs:
- name: Create directory for Dockerfile
run: mkdir -p ${{ github.workspace }}/dockerfiles

- name: Checkout Dockerfile from master
run: |
git init
git remote add origin https://github.com/Xilinx/preflight-check.git
git config core.sparseCheckout true
echo "Dockerfile" >> .git/info/sparse-checkout
git fetch origin master
git checkout master
working-directory: ${{ github.workspace }}/dockerfiles


- name: Checkout Dockerfile from master
run: |
git init
if git remote | grep -q origin; then
git remote remove origin
fi
git remote add origin https://github.com/Xilinx/preflight-check.git
git config core.sparseCheckout true
echo "Dockerfile" >> .git/info/sparse-checkout
git fetch origin master
git checkout master
working-directory: ${{ github.workspace }}/dockerfiles

- name: Checkout private repository
uses: actions/checkout@v3
with:
Expand Down

0 comments on commit 2102da7

Please sign in to comment.