Skip to content
This repository was archived by the owner on Dec 19, 2025. It is now read-only.

Commit e10eb47

Browse files
author
Axel Rindle
committed
Add new option latestOnly
When this option is set to `true`, only the latest release will be fetched
1 parent 4e61ca1 commit e10eb47

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

lib/check.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,13 @@ const rest = (options, callback) => {
9090
});
9191
};
9292

93-
const apiUrl = `https://api.github.com/repos/${options.owner}/${options.repo}/releases`;
93+
// build url
94+
let apiUrl = `https://api.github.com/repos/${options.owner}/${options.repo}/releases`;
95+
if (options.latestOnly) {
96+
apiUrl += '/latest';
97+
}
98+
99+
// define request options
94100
const opts = {
95101
headers: {
96102
'Accept': 'application/vnd.github.v3+json',

0 commit comments

Comments
 (0)