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

improv(repo): allow case-insensitive repo names #83

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
6 changes: 3 additions & 3 deletions src/copybaraAction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export class CopybaraAction {
getCurrentRepo() {
if (!this.current.repo) this.current.repo = `${context.repo.owner}/${context.repo.repo}`;
core.debug(`Current repo is ${this.current.repo}`);
return this.current.repo;
return this.current.repo.toLowerCase();
}

getCurrentBranch() {
Expand Down Expand Up @@ -76,15 +76,15 @@ export class CopybaraAction {
if (!this.config.sot.repo || !this.config.destination.repo)
exit(51, 'You need to set values for "sot_repo" & "destination_repo" or set a value for "workflow".');

if (this.getCurrentRepo() === this.config.sot.repo) {
if (this.getCurrentRepo() === this.config.sot.repo.toLowerCase()) {
if (context.eventName != "push") exit(54, "Nothing to do in the SoT repo except for push events.");

const sotBranch = await this.getSotBranch();
if (this.getCurrentBranch() != sotBranch)
exit(54, `Nothing to do in the SoT repo except on the "${sotBranch}" branch.`);

this.config.workflow = "push";
} else if (this.getCurrentRepo() === this.config.destination.repo) {
} else if (this.getCurrentRepo() === this.config.destination.repo.toLowerCase()) {
if (!this.getPRNumber()) exit(54, "Nothing to do in the destination repo except for Pull Requests.");

const destinationBranch = await this.getDestinationBranch();
Expand Down