mirror of
https://github.com/renovatebot/renovate.git
synced 2025-01-13 07:26:26 +00:00
fix(mix): remove global flag in regex to match multiple organizations (#24091)
This commit is contained in:
parent
36e9537f94
commit
b8823e3deb
2 changed files with 6 additions and 2 deletions
|
@ -238,12 +238,14 @@ describe('modules/manager/mix/artifacts', () => {
|
|||
hostRules.getAll.mockReturnValueOnce([
|
||||
{ matchHost: 'https://hex.pm/api/repos/an_organization/' },
|
||||
{ matchHost: 'https://hex.pm/api/repos/unauthorized_organization/' },
|
||||
{ matchHost: 'https://hex.pm/api/repos/other_organization/' },
|
||||
{ matchHost: 'https://hex.pm/api/repos/does_not_match_org/packages/' },
|
||||
{ matchHost: 'https://example.com/api/repos/also_does_not_match_org/' },
|
||||
{ matchHost: 'hex.pm' },
|
||||
]);
|
||||
hostRules.find.mockReturnValueOnce({ token: 'an_organization_token' });
|
||||
hostRules.find.mockReturnValueOnce({}); // unauthorized_organization token missing
|
||||
hostRules.find.mockReturnValueOnce({ token: 'other_org_token' });
|
||||
hostRules.find.mockReturnValueOnce({ token: 'does_not_match_org_token' });
|
||||
|
||||
// erlang
|
||||
|
@ -283,6 +285,9 @@ describe('modules/manager/mix/artifacts', () => {
|
|||
{
|
||||
cmd: 'mix hex.organization auth an_organization --key an_organization_token',
|
||||
},
|
||||
{
|
||||
cmd: 'mix hex.organization auth other_organization --key other_org_token',
|
||||
},
|
||||
{ cmd: 'mix deps.update some_package' },
|
||||
]);
|
||||
});
|
||||
|
|
|
@ -16,8 +16,7 @@ import type { UpdateArtifact, UpdateArtifactsResult } from '../types';
|
|||
|
||||
const hexRepoUrl = 'https://hex.pm/';
|
||||
const hexRepoOrgUrlRegex = regEx(
|
||||
`https://hex\\.pm/api/repos/(?<organization>[a-z0-9_]+)/$`,
|
||||
'g'
|
||||
`^https://hex\\.pm/api/repos/(?<organization>[a-z0-9_]+)/$`
|
||||
);
|
||||
|
||||
export async function updateArtifacts({
|
||||
|
|
Loading…
Reference in a new issue