AWS' new Github integration does not work with this project
boginw opened this issue · 0 comments
boginw commented
With the new Github (Version 2) integration, the function is unable to retrieve the relevant information from the revision URL.
Current executions lead to CloudWatch reporting the following:
"errorType": "TypeError",
"errorMessage": "Cannot read property '1' of null",
"stack": [
"TypeError: Cannot read property '1' of null",
" at Object.exports.getPipelineExecution (/var/task/index.js:82:19)",
" at processTicksAndRejections (internal/process/task_queues.js:97:5)",
" at async Runtime.exports.handler (/var/task/index.js:22:18)"
]
I tried logging the revision URL from the function, which yielded the following URL:
https://[REGION].console.aws.amazon.com/codesuite/settings/connections/redirect?connectionArn=arn:aws:codestar-connections:eu-west-1:[ACCOUNT-ID]:connection/[UUID]&referenceType=COMMIT&FullRepositoryId=[OWNER]/[REPOSITORY&Commit=[SHA]
It should be possible to detect whether or not the pipeline is using the old or the new Github integration and take the appropriate actions in order to extract the repo, owner, and sha.