I have a bitbucket pipeline yaml file for a project Im working on. I had it running the pipeline fine when it was setup to run on push, but since I switched it to run on pull-request I get an invalid yml error.
I found this description of how to configure the file: https://confluence.atlassian.com/bitbucket/configure-bitbucket-pipelines-yml-792298910.html
In the validator, I get an error at the first step that says Expected a string but found a mapping
.
When I run it via a pull-request, I get the following error:
Configuration error
There is an error in your bitbucket-pipelines.yml at [pipelines > pull-requests].
To be precise: This section should be a map (it is currently defined as a list).
Im not sure how to fix it, because it seems to match the example.
Below is my yml file
image: node:8.10
pipelines:
pull-requests:
- step:
name: Push repo to CodeCommit
script:
- echo $CodeCommitKey > ~/.ssh/codecommit_rsa.tmp
- base64 -di ~/.ssh/codecommit_rsa.tmp > ~/.ssh/codecommit_rsa
- chmod 400 ~/.ssh/codecommit_rsa
- echo $CodeCommitConfig > ~/.ssh/config.tmp
- base64 -di ~/.ssh/config.tmp > ~/.ssh/config
- set +e
- ssh -o StrictHostKeyChecking=no $CodeCommitHost
- set -e
- git remote add codecommit ssh://$CodeCommitRepo
- git push codecommit $BITBUCKET_BRANCH
- step:
name: Test and Build
caches:
- node
script:
- npm install --no-package-lock
- npm run test
- step:
name: Deploy Serverless
script:
- npm i serverless -g
- npm run deploy