Skip to content

Conversation

@CloudNStoyan
Copy link
Contributor

Fixes #489

When extracting the directory from the branch name of a Dependabot PR that uses groups, the branch name will only include the group name instead of dependency names as described below:

This issue is caused by https://github.com/dependabot/fetch-metadata/blob/main/src/dependabot/update_metadata.ts#L52
That code is expecting the branch name to contain the dependency name when for grouped updates it will only contain the group name, and because all the dependency names contain multiple /s it is failing to get the directory name.
This is similar to #493 and #494, but it is not addressed by my pr #495.
Originally posted by @dreid in #489 (comment)

I have fixed that and I have added 3 tests to test the new logic

I also had to edit this test because it depended on the broken group logic

test('it supports returning information about grouped updates', async () => {

Here the test checks if the directory is set to / while the PR is a group one and the branch name is this: dependabot/docker/gh-base-image/docker-1234566789 which is incorrect, here the directory should be gh-base-image

@CloudNStoyan CloudNStoyan requested a review from a team as a code owner October 24, 2024 12:47
Copy link
Member

@Nishnha Nishnha left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Nishnha Nishnha merged commit 3da9521 into dependabot:main Jan 24, 2025
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fetch-metadata action returns / for directory output

2 participants