microsoft / azure-pipelines-tasks

Tasks for Azure Pipelines
https://aka.ms/tfbuild
MIT License
3.47k stars 2.61k forks source link

[BUG]: TwineAuthenticateV1 produces incorrect path for windows #19425

Open aeb-dev opened 8 months ago

aeb-dev commented 8 months ago

New issue checklist

Task name

TwineAuthenticateV1

Task version

V1

Issue Description

TwineAuthenticateV1 produces incorrect path for windows. It is missing \ on the hard drive part

Environment type (Please select at least one enviroment where you face this issue)

Azure DevOps Server type

dev.azure.com (formerly visualstudio.com)

Azure DevOps Server Version (if applicable)

No response

Operation system

windows-latest

Relevant log output

for echo the following is printed `D:a_temptwineAuthenticateIDxXp3.pypirc`
for cat the following error is printed: `cat: 'D:a_temptwineAuthenticateIDxXp3.pypirc': No such file or directory

Full task logs with system.debug enabled

No response

Repro steps

strategy:
  matrix:
    windows:
      imageName: "windows-latest"

pool:
  vmImage: $(imageName)

steps:
  - task: TwineAuthenticate@1
    inputs:
      artifactFeed: Theorem/Theorem_Feed
    displayName: "Twine Authenticate"
  - bash: |
      echo $(PYPIRC_PATH)
      cat $(PYPIRC_PATH)
    displayName: "Cat PYPIRC"
aeb-dev commented 8 months ago

for people searching for a workaround

if [[ $(imageName) = "windows-latest" ]]; then
  PYPIRC_PATH=$(echo "${PYPIRC_PATH}" | tr "D:" "D:\\")
fi

Then use $PYPIRC_PATH instead of $($PYPIRC_PATH)