Skip to content

Commit ed937ac

Browse files
committed
Explicitly set types on github module
1 parent f0669e0 commit ed937ac

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

packages/build/src/github.ts

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,22 @@
11
import { Octokit } from '@octokit/rest';
22
import semver from 'semver';
33

4+
/**
5+
* The repo we are working on.
6+
*/
47
const REPO = Object.freeze({
58
owner: 'mongodb-js',
69
repo: 'mongosh'
710
});
811

12+
/**
13+
* Determine if this version is releasable.
14+
*
15+
* @param {string} version - The current version.
16+
* @param {Octokit} octokit - The octokit instance.
17+
*
18+
* @returns {Promise} The promise of the boolean.
19+
*/
920
const isReleasable = async(version: string, octokit: Octokit): Promise<boolean> => {
1021
const latestRelease = await getLatestRelease(octokit);
1122
return semver.gt(version, latestRelease.tag_name.replace('v', ''));
@@ -27,7 +38,7 @@ const getLatestRelease = async(octokit: Octokit): Promise<any> => {
2738
return data;
2839
};
2940

30-
const createRelease = (version: string, octokit: Octokit) => {
41+
const createRelease = (version: string, octokit: Octokit): Promise<any> => {
3142
const params = {
3243
...REPO,
3344
tag_name: `v${version}`,
@@ -37,7 +48,7 @@ const createRelease = (version: string, octokit: Octokit) => {
3748
return octokit.repos.createRelease(params);
3849
};
3950

40-
const uploadAsset = (artifact: string, octokit: Octokit) => {
51+
const uploadAsset = (artifact: string, octokit: Octokit): Promise<any> => {
4152
const params = {
4253
...REPO,
4354
release_id: 1,

0 commit comments

Comments
 (0)