diff --git a/dist/index.js b/dist/index.js index 6deb35a..fbdabbd 100644 --- a/dist/index.js +++ b/dist/index.js @@ -13410,6 +13410,7 @@ function parse(commitMessage, branchName, mainBranch) { const yamlFragment = commitMessage.match(/^-{3}\n(?[\S|\s]*?)\n^\.{3}\n/m); if ((yamlFragment === null || yamlFragment === void 0 ? void 0 : yamlFragment.groups) && branchName.startsWith('dependabot')) { const data = yaml.parse(yamlFragment.groups.dependencies); + // Since we are on the `dependabot` branch (9 letters), the 10th letter in the branch name is the delimiter const delim = branchName[10]; const chunks = branchName.split(delim); const dirname = chunks.slice(2, -1).join(delim) || '/'; diff --git a/src/dry-run.ts b/src/dry-run.ts index ddcf7a8..f9597d1 100755 --- a/src/dry-run.ts +++ b/src/dry-run.ts @@ -7,7 +7,7 @@ import { hideBin } from 'yargs/helpers' import { getMessage } from './dependabot/verified_commits' import { parse } from './dependabot/update_metadata' -import { parseNwo } from './dependabot/util' +import { getBranchNames, parseNwo } from './dependabot/util' async function check (args: any): Promise { try { @@ -42,8 +42,9 @@ async function check (args: any): Promise { if (commitMessage) { console.log('This appears to be a valid Dependabot Pull Request.') + const branchNames = getBranchNames(github.context) - const updatedDependencies = parse(commitMessage, 'dependabot/test_ecosystem/test_directory', 'test_branch') + const updatedDependencies = parse(commitMessage, branchNames.headName, branchNames.baseName) if (updatedDependencies.length > 0) { console.log('Updated dependencies:')