Skip to content

Commit

Permalink
fix: update aws-cdk-lib dependency and GitHubRepo.repository logic (
Browse files Browse the repository at this point in the history
#1776)

* Allow versions of aws-cdk-lib greater than

* Fix repo parsing logic

---------

Co-authored-by: Leonardo Gama <[email protected]>
  • Loading branch information
Leo10Gama and Leonardo Gama authored Nov 21, 2024
1 parent 9a22548 commit d380c26
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 24 deletions.
10 changes: 5 additions & 5 deletions lib/__tests__/auto-build.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ beforeEach(() => {
test('webhooks are enabled by default', () => {
new AutoBuild(stack, 'AutoBuild', {
repo: new GitHubRepo({
repository: 'some-repo',
repository: 'some-owner/some-repo',
tokenSecretArn: 'arn:aws:secretsmanager:someregion:someaccount:secret:sometoken',
}),
});
Expand All @@ -38,7 +38,7 @@ test('webhooks are enabled by default', () => {
test('webhooks for a single branch', () => {
new AutoBuild(stack, 'AutoBuild', {
repo: new GitHubRepo({
repository: 'some-repo',
repository: 'some-owner/some-repo',
tokenSecretArn: 'arn:aws:secretsmanager:someregion:someaccount:secret:sometoken',
}),
branch: 'banana',
Expand Down Expand Up @@ -77,7 +77,7 @@ test('webhooks for a single branch', () => {
test('webhooks for multiple branches', () => {
new AutoBuild(stack, 'AutoBuild', {
repo: new GitHubRepo({
repository: 'some-repo',
repository: 'some-owner/some-repo',
tokenSecretArn: 'arn:aws:secretsmanager:someregion:someaccount:secret:sometoken',
}),
branches: ['banana', 'grapefruit'],
Expand Down Expand Up @@ -116,7 +116,7 @@ test('webhooks for multiple branches', () => {
test('can disable webhooks', () => {
new AutoBuild(stack, 'AutoBuild', {
repo: new GitHubRepo({
repository: 'some-repo',
repository: 'some-owner/some-repo',
tokenSecretArn: 'arn:aws:secretsmanager:someregion:someaccount:secret:sometoken',
}),
webhook: false,
Expand All @@ -133,7 +133,7 @@ test('can disable webhooks', () => {
test('can enable artifacts', () => {
new AutoBuild(stack, 'AutoBuild', {
repo: new GitHubRepo({
repository: 'some-repo',
repository: 'some-owner/some-repo',
tokenSecretArn: 'arn:aws:secretsmanager:someregion:someaccount:secret:sometoken',
}),
artifacts: Artifacts.s3({
Expand Down
3 changes: 3 additions & 0 deletions lib/repo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,9 @@ export class GitHubRepo implements IRepo {

constructor(props: GitHubRepoProps) {
const repository = props.repository;
if (repository.indexOf('/') == -1) {
throw new Error('Repository must be of the form "account/repo"');
}
const [owner, repo] = repository.split('/');

this.owner = owner;
Expand Down
4 changes: 2 additions & 2 deletions package.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

43 changes: 26 additions & 17 deletions yarn.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit d380c26

Please sign in to comment.