in cfn, it can be done as below
xxxCodebuild: Type: AWS::CodeBuild::Project Properties: Source: Type: GITHUB Location: https://github.com/xxx GitCloneDepth: 1 SourceVersion: develop