Skip to content

Commit

Permalink
feat(bazel): set sourceUrl for Bazel modules (#33840)
Browse files Browse the repository at this point in the history
Co-authored-by: Michael Kriese <[email protected]>
  • Loading branch information
r0bobo and viceice authored Jan 27, 2025
1 parent bc1b1e6 commit 65c0561
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"homepage": "https://github.com/foo/bar",
"versions": [
"0.14.8",
"0.14.9",
Expand Down
1 change: 1 addition & 0 deletions lib/modules/datasource/bazel/index.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ describe('modules/datasource/bazel/index', () => {
{ version: '0.15.0' },
{ version: '0.16.0' },
],
sourceUrl: 'https://github.com/foo/bar',
});
});

Expand Down
3 changes: 3 additions & 0 deletions lib/modules/datasource/bazel/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@ export class BazelDatasource extends Datasource {
}
return release;
});
if (metadata.homepage) {
result.homepage = metadata.homepage;
}
} catch (err) {
// istanbul ignore else: not testable with nock
if (err instanceof HttpError) {
Expand Down
1 change: 1 addition & 0 deletions lib/modules/datasource/bazel/schema.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { z } from 'zod';

export const BazelModuleMetadata = z.object({
homepage: z.string().optional().nullable(),
versions: z.array(z.string()),
yanked_versions: z.record(z.string(), z.string()),
});

0 comments on commit 65c0561

Please sign in to comment.