Skip to content

Commit

Permalink
Pull the group name from commit metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
Nishnha committed Jun 22, 2023
1 parent b534cb5 commit b8e8f8c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/dependabot/update_metadata.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -197,12 +197,15 @@ test('it supports returning information about grouped updates', async () => {
'- dependency-name: github.com/docker/cli\n' +
' dependency-type: direct:production\n' +
' update-type: version-update:semver-patch\n' +
' dependency-group: docker\n' +
'- dependency-name: github.com/docker/docker\n' +
' dependency-type: direct:production\n' +
' update-type: version-update:semver-patch\n' +
' dependency-group: docker\n' +
'- dependency-name: github.com/moby/moby\n' +
' dependency-type: direct:production\n' +
' update-type: version-update:semver-patch\n' +
' dependency-group: docker\n' +
'...\n' +
'\n' +
'Signed-off-by: dependabot[bot] <[email protected]>\n'
Expand Down
2 changes: 1 addition & 1 deletion src/dependabot/update_metadata.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export async function parse (commitMessage: string, body: string, branchName: st
const bumpFragment = commitMessage.match(/^Bumps .* from (?<from>v?\d[^ ]*) to (?<to>v?\d[^ ]*)\.$/m)
const updateFragment = commitMessage.match(/^Update .* requirement from \S*? ?(?<from>v?\d\S*) to \S*? ?(?<to>v?\d\S*)$/m)
const yamlFragment = commitMessage.match(/^-{3}\n(?<dependencies>[\S|\s]*?)\n^\.{3}\n/m)
const groupName = commitMessage.match(/^Bumps the (?<name>\S*) group with/m)
const groupName = commitMessage.match(/dependency-group:\s(?<name>\S*)/m)
const newMaintainer = !!body.match(/Maintainer changes/m)
const lookupFn = lookup ?? (() => Promise.resolve({ alertState: '', ghsaId: '', cvss: 0 }))
const scoreFn = getScore ?? (() => Promise.resolve(0))
Expand Down
3 changes: 3 additions & 0 deletions src/main.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -229,12 +229,15 @@ test('it supports returning information about grouped updates', async () => {
'- dependency-name: github.com/docker/cli\n' +
' dependency-type: direct:production\n' +
' update-type: version-update:semver-patch\n' +
' dependency-group: docker\n' +
'- dependency-name: github.com/docker/docker\n' +
' dependency-type: direct:production\n' +
' update-type: version-update:semver-patch\n' +
' dependency-group: docker\n' +
'- dependency-name: github.com/moby/moby\n' +
' dependency-type: direct:production\n' +
' update-type: version-update:semver-patch\n' +
' dependency-group: docker\n' +
'...\n' +
'\n' +
'Signed-off-by: dependabot[bot] <[email protected]>\n'
Expand Down

0 comments on commit b8e8f8c

Please sign in to comment.