Skip to content

Commit

Permalink
feat: extract artifactory timestamps from columns (#33187)
Browse files Browse the repository at this point in the history
  • Loading branch information
Arc676 authored Jan 9, 2025
1 parent 6e8b70e commit 6bb6878
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ <h1>Index</h1>
<pre>
<a href="..">..</a>
<a href="1.0.0">1.0.0</a> 21-Jul-2021 20:08 -
<a href="1.0.1">1.0.1</a> 23-Aug-2021 20:03 -
<a href="1.0.2">1.0.2</a> 21-Jul-2021 20:09 -
<a href="1.0.3">1.0.3</a> 06-Feb-2021 09:54 -
<a href="1.0.1">1.0.1</a> 23-Aug-2021 20:03 12 MB
<a href="1.0.2">1.0.2</a> 21-Jul-2021 20:09 123.45 GB
<a href="1.0.3">1.0.3</a> 06-Feb-2021 09:54 9.0 KB
</pre>
<hr/>
<address style="font-size:small;">Artifactory Port 8080</address>
Expand Down
5 changes: 4 additions & 1 deletion lib/modules/datasource/artifactory/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,9 @@ export class ArtifactoryDatasource extends Datasource {
}

private static parseReleaseTimestamp(rawText: string): string {
return rawText.trim().replace(regEx(/ ?-$/), '') + 'Z';
return (
rawText.split(regEx(/\s{2,}/)).filter((e) => !isNaN(Date.parse(e)))[0] +
'Z'
);
}
}

0 comments on commit 6bb6878

Please sign in to comment.