Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: update aws-cdk-lib dependency and GitHubRepo.repository logic #1776

Merged
merged 3 commits into from
Nov 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.