mirror of
https://github.com/dependabot/fetch-metadata.git
synced 2026-03-12 18:07:12 -04:00
Using branchNames per @Nishnha's suggestion
This commit is contained in:
1
dist/index.js
generated
vendored
1
dist/index.js
generated
vendored
@@ -13410,6 +13410,7 @@ function parse(commitMessage, branchName, mainBranch) {
|
||||
const yamlFragment = commitMessage.match(/^-{3}\n(?<dependencies>[\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) || '/';
|
||||
|
||||
@@ -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<void> {
|
||||
try {
|
||||
@@ -42,8 +42,9 @@ async function check (args: any): Promise<void> {
|
||||
|
||||
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:')
|
||||
|
||||
Reference in New Issue
Block a user