Skip to content

Commit

Permalink
fetch branch after check
Browse files Browse the repository at this point in the history
  • Loading branch information
Hau-Hau committed Sep 20, 2024
1 parent 22218c4 commit 1809641
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion .github/actions/update-nuspec-file-action/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ runs:
run: |
git config --global user.name "GitHub Action"
git config --global user.email "action@github.com"
git fetch origin $TARGET_BRANCH_NAME:$TARGET_BRANCH_NAME
IS_TARGET_BRANCH_EXISTS=$(git ls-remote --heads origin $TARGET_BRANCH_NAME | grep -q "refs/heads/$TARGET_BRANCH_NAME" && echo true || echo false)
echo "IS_TARGET_BRANCH_EXISTS=$IS_TARGET_BRANCH_EXISTS" >> $GITHUB_ENV
if [[ "$IS_TARGET_BRANCH_EXISTS" == "true" ]]; then
git fetch origin $TARGET_BRANCH_NAME:$TARGET_BRANCH_NAME
git checkout $TARGET_BRANCH_NAME
git reset --hard main
else
Expand Down

0 comments on commit 1809641

Please sign in to comment.