Merge pull request #304 from mikepenz/feature/improved_error_handling
Improved error logs
This commit is contained in:
+6
@@ -974,6 +974,12 @@ class Tags {
|
||||
return tags[0];
|
||||
}
|
||||
catch (error) {
|
||||
if (tags.length < 1) {
|
||||
core.warning(`⚠️ Only one tag found for the given repository`);
|
||||
}
|
||||
else if (tags.length < 0) {
|
||||
core.warning(`⚠️ No tag found for the given repository`);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
});
|
||||
|
||||
+1
-1
File diff suppressed because one or more lines are too long
+2
-1
@@ -36,7 +36,8 @@ export class Commits {
|
||||
): Promise<CommitInfo[]> {
|
||||
// Fetch comparisons recursively until we don't find any commits
|
||||
// This is because the GitHub API limits the number of commits returned in a single response.
|
||||
let commits: RestEndpointMethodTypes['repos']['compareCommits']['response']['data']['commits'] = []
|
||||
let commits: RestEndpointMethodTypes['repos']['compareCommits']['response']['data']['commits'] =
|
||||
[]
|
||||
let compareHead = head
|
||||
// eslint-disable-next-line no-constant-condition
|
||||
while (true) {
|
||||
|
||||
+2
-1
@@ -84,7 +84,8 @@ export class PullRequests {
|
||||
})
|
||||
|
||||
for await (const response of this.octokit.paginate.iterator(options)) {
|
||||
type PullsListData = RestEndpointMethodTypes['pulls']['list']['response']['data']
|
||||
type PullsListData =
|
||||
RestEndpointMethodTypes['pulls']['list']['response']['data']
|
||||
const prs: PullsListData = response.data as PullsListData
|
||||
|
||||
for (const pr of prs.filter(p => !!p.merged_at)) {
|
||||
|
||||
+7
-1
@@ -26,7 +26,8 @@ export class Tags {
|
||||
})
|
||||
|
||||
for await (const response of this.octokit.paginate.iterator(options)) {
|
||||
type TagsListData = RestEndpointMethodTypes['repos']['listTags']['response']['data']
|
||||
type TagsListData =
|
||||
RestEndpointMethodTypes['repos']['listTags']['response']['data']
|
||||
const tags: TagsListData = response.data as TagsListData
|
||||
|
||||
for (const tag of tags) {
|
||||
@@ -80,6 +81,11 @@ export class Tags {
|
||||
}
|
||||
return tags[0]
|
||||
} catch (error) {
|
||||
if (tags.length < 1) {
|
||||
core.warning(`⚠️ Only one tag found for the given repository`)
|
||||
} else if (tags.length < 0) {
|
||||
core.warning(`⚠️ No tag found for the given repository`)
|
||||
}
|
||||
return null
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user