I have a self hosted runner running on Windows. I have a step in my pipeline to create a label and tag the current branch with that label.
I looked at long thread in this community that it should work. But it is not working.
The step is below:
- step:
name: 'Tag the repo with build label'
runs-on:
- 'self.hosted'
- 'windows'
- 'aio'
script:
- echo "Tagging repo with label"
if ( $Env:BITBUCKET_BRANCH -match "feature/*" )
{
${BRANCH_PART} = "integration";
}
elseif ( $Env:BITBUCKET_BRANCH -match "release/*" )
{
${BRANCH_PART} = "release";
};
${RELEASE_CODENAME}="chicago";
${REPO_TAG} = "${BRANCH_PART}_${RELEASE_CODENAME}_$Env:BITBUCKET_BUILD_NUMBER";
git tag -am "Tagging for build $Env:BITBUCKET_BUILD_NUMBER" "${REPO_TAG}";
git remote set-url origin "$Env:BITBUCKET_GIT_HTTP_ORIGIN";
git push --dry-run;
echo git push origin "${REPO_TAG}";
I understand the script doesn't look like Bash script. It is because Windows runners run with Powershell as the parent shell. All those script lines are proper powershell script code.
The error I am seeing is this:
bash: /dev/tty: No such device or address
error: failed to execute prompt script (exit code 1)
fatal: could not read Username for 'https://bitbucket.org': No such file or directory
git
push
origin
integration_chicago_33