Skip to content

Commit

Permalink
CONFIG: checkout & fetch changes if branch is new
Browse files Browse the repository at this point in the history
  • Loading branch information
UmairJibran committed May 21, 2023
1 parent 2885b05 commit 394f96c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,13 @@ runs:
git branch -m $BRANCH
echo "SETTING UP GIT REMOTE"
git remote add origin https://${{ github.repository_owner }}:${{ env.GITHUB_PAT }}@github.com/${{ github.repository }}.git
echo "CHECKING OUT \`$BRANCH\`"
git checkout $BRANCH
echo "FETCHING LATEST CODE AT \`$BRANCH\`"
git pull origin $BRANCH
else
git remote set-url origin https://${{ github.repository_owner }}:${{ env.GITHUB_PAT }}@github.com/${{ github.repository }}.git
fi
echo "FETCHING LATEST CODE AT \`$BRANCH\`"
git pull origin $BRANCH
echo "CHECKING OUT \`$BRANCH\`"
git checkout $BRANCH
git fetch
if ! git ls-remote --exit-code --heads origin ${{ env.TARGET_BRANCH }} >/dev/null 2>&1; then
echo "CREATING \`${{ env.TARGET_BRANCH }}\`"
Expand Down

0 comments on commit 394f96c

Please sign in to comment.