1
votes

I was creating a pipeline with a source as Codecommit and using CodePipeline to deploy code maintained in a CodeCommit repository to a single Amazon EC2 instance. Your pipeline is triggered when you push a change to the CodeCommit repository.

But while executing pipeline I am facing below error:-

Invalid action configuration
The action failed because no branch named master was found in the selected AWS CodeCommit repository MyDemoRepo. Make sure you are using the correct branch name, and then try again. Error: null

Can you please help me I this issue.

1
The error is pretty clear, MyDemoRepo master branch is missingAmit Baranes
yes but master branch is the branch which is mde by default i believe and we don't have to create it as i had tried creating it but for creating branch that option is greyed out for my IAM user.aayushi

1 Answers

2
votes

By default when you create a repository in CodeCommit via Console or CLI [1], no branch is created, as can be confirmed using command:

$ git ls-remote https://git-codecommit.us-east-1.amazonaws.com/v1/repos/MyDemoRepo

Please push some code:

$ git clone https://git-codecommit.us-east-1.amazonaws.com/v1/repos/MyDemoRepo
$ touch a.txt
$ git checkout -b  master
$ git add .
$ git commit -m "Initial Commit"
$ git push

[1] https://docs.aws.amazon.com/cli/latest/reference/codecommit/create-repository.html