Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

codepipelineActions.CodeCommitSourceAction: Default branch is 'Master' #27710

Closed
alexclifton4 opened this issue Oct 27, 2023 · 2 comments · Fixed by #27753
Closed

codepipelineActions.CodeCommitSourceAction: Default branch is 'Master' #27710

alexclifton4 opened this issue Oct 27, 2023 · 2 comments · Fixed by #27753
Labels
@aws-cdk/aws-codepipeline-actions bug This issue is a bug. effort/small Small work item – less than a day of effort p2

Comments

@alexclifton4
Copy link

alexclifton4 commented Oct 27, 2023

Describe the bug

When creating the resource codepipelineActions.CodeCommitSourceAction, if branch is not specified, it will default to 'master'.

However, when creating a CodeCommit repository through the console, the default branch is 'main', meaning that if everything is kept as default, the pipeline will fail.

Expected Behavior

The default branch on codepipelineActions.CodeCommitSourceAction should be the same as the default branch in CodeCommit

Current Behavior

codepipelineActions.CodeCommitSourceAction defaults to 'master'. If defaults are used, the following error occurs in the pipeline: The action failed because no branch named master was found in the selected AWS CodeCommit repository

Reproduction Steps

  1. Create a codecommit repo from the console called 'testRepo'.
  2. Upload at least one file through the console - this will create the default branch main
pipeline = codepipeline.Pipeline(self, "testPipeline")
sourceOutput = codepipeline.Artifact()
repo = codecommit.Repository.from_repository_name(self, "testRepo", "testRepo")
pipeline.add_stage(stage_name="Source", actions=[
    codepipelineActions.CodeCommitSourceAction(action_name="CodeCommit", repository=repo, output=sourceOutput)
])
  1. Once CDK has deployed, observe the pipeline in the console - it will have failed.

Possible Solution

Change the default branch in CDK from "master" to "main"

Additional Information/Context

No response

CDK CLI Version

2.100.0 (build e1b5c77)

Framework Version

No response

Node.js Version

v18.12.1

OS

macOS 13.5.2 (22G91)

Language

Python

Language Version

Python 3.9.6 (default, Aug 11 2023, 19:44:49)

Other information

No response

@alexclifton4 alexclifton4 added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Oct 27, 2023
@khushail khushail added investigating This issue is being investigated and/or work is in progress to resolve the issue. and removed needs-triage This issue or PR still needs to be triaged. labels Oct 27, 2023
@khushail
Copy link
Contributor

Hi @alexclifton4 ,thanks for reporting this. I am able to repro this.

@khushail khushail added p2 effort/small Small work item – less than a day of effort and removed investigating This issue is being investigated and/or work is in progress to resolve the issue. labels Oct 28, 2023
@mergify mergify bot closed this as completed in #27753 Nov 1, 2023
mergify bot pushed a commit that referenced this issue Nov 1, 2023
…nder feature flag) (#27753)

Closes #27710.

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Copy link

github-actions bot commented Nov 1, 2023

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@aws-cdk/aws-codepipeline-actions bug This issue is a bug. effort/small Small work item – less than a day of effort p2
Projects
None yet
2 participants