Skip to content

Commit

Permalink
Clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
rhyskoedijk committed Oct 10, 2024
1 parent 7f21324 commit 398b67f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -98,15 +98,13 @@ export class DependabotOutputProcessor implements IDependabotUpdateOutputProcess

// Create a new pull request
const changedFiles = getPullRequestChangedFilesForOutputData(data);
const directory =
update.config.directory || update.config.directories?.find((dir) => changedFiles[0]?.path?.startsWith(dir));
const dependencies = getPullRequestDependenciesPropertyValueForOutputData(data);
const targetBranch =
update.config['target-branch'] || (await this.prAuthorClient.getDefaultBranch(project, repository));
const sourceBranch = getBranchNameForUpdate(
update.config['package-ecosystem'],
targetBranch,
directory,
update.config.directory || update.config.directories?.find((dir) => changedFiles[0]?.path?.startsWith(dir)),
dependencies['dependency-group-name'],
dependencies['dependencies'] || dependencies,
update.config['pull-request-branch-name']?.separator,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ function sanitizeRef(refParts: string[], separator): string {
.replace(/[^A-Za-z0-9\/\-_.(){}]/g, '')
// Slashes can't be followed by periods
.replace(/\/\./g, '/dot-')
// Squeeze out consecutive periods and slashes
.replace(/\.+/g, '.')
.replace(/\/+/g, '/')
// Trailing periods are forbidden
Expand Down

0 comments on commit 398b67f

Please sign in to comment.