AWS CloudFormation:如何在 AWS Pipeline 中使用 Github Enterprise 作为源

问题描述

在文档中,我们给出了以下示例:

//def work_version = "2.4.0"

def work_version = "2.5.0-beta02"

// (Java only)
implementation "androidx.work:work-runtime:$work_version"

我已尝试将其更新为使用 GitHub 企业版,但不幸的是它不起作用。 有人可以展示如何正确配置它。 这就是我尝试这样做的方式:

AppPipeline: 
  Type: AWS::CodePipeline::Pipeline 
  Properties: 
    RoleArn:
      Ref: CodePipelineServiceRole 
    Stages: 
      - 
        Name: Source 
        Actions: 
          - 
            Name: SourceAction
            ActionTypeId: 
              Category: Source 
              Owner: AWS 
              Version: 1 
              Provider: S3 
            OutputArtifacts: 
              - 
                Name: SourceOutput 
            Configuration: 
              S3Bucket: 
                Ref: SourceS3Bucket 
              S3ObjectKey: 
                Ref: SourceS3ObjectKey 
            RunOrder: 1

更新:

我发现 Github Enterprise 使用 codestar-connections。 我已将代码编辑为如下所示:

- Name: Source
  Actions:
    - Name: Source
      RunOrder: 1
      InputArtifacts: []
      ActionTypeId:
        Category: Source
        Owner: ThirdParty
        Provider: GitHubEnterpriseServer
      Configuration:
        Owner: !Sub ${GitHubRepositoryOwner}
        Repo: !Sub ${GitHubRepositoryName}
        Branch: !Sub ${GitHubIntegrationBranch}
        OAuthToken: !Sub ${GitHubPersonalAccessToken}
        PollForSourceChanges: false # Must be set to false when using webhooks
      OutputArtifacts:
        - Name: SourceArtifact

我现在处理的问题是连接权限:

  Stages:
    - Name: Source
      Actions:
        - InputArtifacts: []
          ActionTypeId:
            Version: '1'
            Owner: AWS
            Category: Source
            Provider: CodeStarSourceConnection
          OutputArtifacts:
            - Name: SourceArtifact
          RunOrder: 1
          Configuration:
            ConnectionArn: "arn:aws:codestar-connections:exxxxxxxxf382816da8"
            FullRepositoryId: "https://github.xxxxxx/cloudformation"
            BranchName: "main"
            OutputArtifactFormat: "CODE_ZIP"
          Name: ApplicationSource

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)