我正在创建一个以Codecommit作为源的管道,并使用CodePipeline将在CodeCommit存储库中维护的代码部署到单个Amazon EC2实例。当您将更改推送到CodeCommit存储库时,将触发管道。
但是在执行管道时,我面临以下错误:-
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
这个问题你能帮我吗?
答案 0 :(得分:2)
默认情况下,当您通过控制台或CLI [1]在CodeCommit中创建存储库时,不会创建任何分支,可以使用以下命令确认:
$ git ls-remote https://git-codecommit.us-east-1.amazonaws.com/v1/repos/MyDemoRepo
请输入一些代码:
$ 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