Here is what I am trying to do:
- I have a pipeline which runs on ubuntu image.
- As a part of pipeline, I want to push commits to the bitbucket cloud.
- I have written a simple bash script to do this but it seems like
Azure DevOps pipeline task
- job: Git_Merge
steps:
- task: Bash@3
inputs:
filePath: merge.sh
env:
SOURCE_BRANCH: ${{ parameters.source_branch }}
TARGET_BRANCH: ${{ parameters.target_branch }}
merge.sh
#!/bin/bash
echo "SOURCE BRANCH IS $SOURCE_BRANCH"
echo "TARGET BRANCH IS $TARGET_BRANCH"
if [[ "$SOURCE_BRANCH" == "$TARGET_BRANCH" ]]; then
echo "Source and Target branch names are the same so no merge is needed."
exit
fi
echo "GIT CHECKOUT $TARGET_BRANCH"
git checkout "$TARGET_BRANCH"
echo "GIT STATUS"
git status
echo "GIT MERGE"
git merge "origin/$SOURCE_BRANCH" -m "Merge $SOURCE_BRANCH to $TARGET_BRANCH [skip ci]"
echo "GIT STATUS"
git status
echo "GIT PUSH"
git push origin
echo "GIT STATUS"
git status
Error
fatal: could not read Username for 'https://bitbucket.org': terminal prompts disabled