aws / aws/aws-toolkit-azure-devops

AWSShellScript@1 can't locate the file in workingDirectory

Open
#488 3 comments 8 reactions 0 assignees View on GitHub
bug
Dominant language
TypeScript
Stars
258
Forks
114
PR merge metrics
No merged PRs in 30d

Description

**Describe the bug**

**To reproduce**

1. Azure Pipeline step include two tasks. Script lists the files in workingDirectory and then AWSShellScript to run the script from workingDirectory
```
steps:
- checkout: GunslingerRepo
- checkout: self

- script: |
ls
displayName: Validate variable
workingDirectory: '$(System.DefaultWorkingDirectory)/temp/'

- task: AWSShellScript@1
displayName: 'Functional Test'
inputs:
awsCredentials: 'terraform-azuredevops-development'
regionName: 'eu-central-1'
scriptType: 'filePath'
arguments: '${{parameters.branch}} ${{parameters.validation}} ${{parameters.dataflow}} ${{parameters.iterations}} $(case1) $(case2) $(case3) $(case4)'
filePath: ./functional-test.sh
workingDirectory: '$(System.DefaultWorkingDirectory)/temp/'
```

**Expected behavior**

Expected the file function-test.sh in workingDirectory to be found and executed successfully.

**Screenshots**

The first task lists the files in the workingDirectory:
![image](https://user-images.githubusercontent.com/31384606/200805311-6bb2ae51-8d49-4f4e-94af-b9d62a741e74.png)

AWSShellScript can't find the file from workingDirectory

![image](https://user-images.githubusercontent.com/31384606/200805505-afb29323-b545-4b6d-90fb-f16b9fa30a38.png)

**Your Environment**

- On-prem or cloud based?: Azure DevOps
- Azure DevOps version: Version Dev19.M212.1 (AzureDevOps_M212_20221030.1)
- AWS Toolkit for Azure DevOps version: 1.13.0

**Additional context**

Contributor guide

Open the contributing guide

Research direction

Start with the AWSShellScript@1 task's handling of filePath and workingDirectory, then reproduce the two-checkout pipeline shown in the issue. Compare the successful file listing with the task's file lookup and confirm that a script in the specified workingDirectory is found and executed.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, azure, typescript
Domain
ci-cd, cloud, devops
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.