AWS Codebuild createProjectメソッドがありませんGithub authのOAuthトークンパラメータ?AWS Codebuild createProjectメソッドにGithub authのoauthトークンパラメータがありませんか?
私はCodePipelineを使用しないでください。プログラムでGithubトークンを使用してコードビルドプロジェクトを作成したいのですが、GitHubトークンを含める方法が見つからないようです。誰かがこれを経験したように?
var params = {
artifacts: {
/* required */
type: 'S3',
location: 'STRING_VALUE',
packaging: 'ZIP'
},
environment: {
/* required */
computeType: 'BUILD_GENERAL1_LARGE',
image: 'aws/codebuild/nodejs:4.3.2', /* required */
type: "LINUX_CONTAINER",
},
name: key, /* required */
source: {
/* required */
type: "GITHUB",
auth: {
type: "OAUTH"
},
buildspec: 'echo "test";',
location: `https://github.com/${original.organizations.name}/${original.repos.name}.git`,
},
description: 'STRING_VALUE',
serviceRole: 'arn:aws:iam::171566796811:role/tmmmm6',
timeoutInMinutes: 5
};
codebuild.createProject(params, function (err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
console.log("WEBHOOK")
var params = {
projectName: key /* required */
};
codebuild.createWebhook(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
});
私は、次のURL形式を試してみました: https://${original.github.token}:@github.com/${original.organizations.name}/${original.repos.name}.git
が、それは動作しません。 CodebuildはWebhookを作成できません。
ここにはドキュメントがあります。 http://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/CodeBuild.html GitHubアクセストークンを使用してコードビルドを作成することはできますか?私はコードパイプラインでそれを行う方法を知っていますが、可能であればコードパイプラインを使用しないでください。