Skip to content

Commit

Permalink
build(deps): bump @octokit/rest from 18.5.6 to 18.6.7 (#209)
Browse files Browse the repository at this point in the history
* build(deps): bump @octokit/rest from 18.5.6 to 18.6.7

Bumps [@octokit/rest](https://github.com/octokit/rest.js) from 18.5.6 to 18.6.7.
- [Release notes](https://github.com/octokit/rest.js/releases)
- [Commits](octokit/rest.js@v18.5.6...v18.6.7)

---
updated-dependencies:
- dependency-name: "@octokit/rest"
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>

* fix(types): fix code after changes in types of octokit

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Thibaud Desodt <[email protected]>
  • Loading branch information
dependabot[bot] and tsimbalar authored Jul 19, 2021
1 parent 8ba0cda commit ecbc805
Show file tree
Hide file tree
Showing 3 changed files with 67 additions and 63 deletions.
110 changes: 55 additions & 55 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
},
"dependencies": {
"@octokit/plugin-throttling": "3.5.1",
"@octokit/rest": "18.5.6",
"@octokit/rest": "18.6.7",
"@tsoa/runtime": "3.8.0",
"date-fns": "2.22.1",
"express": "4.17.1",
Expand Down
18 changes: 11 additions & 7 deletions src/infra/github/WorkflowRunRepository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import {
WorkflowRunsPerBranch,
} from '../../domain/IWorkflowRunRepository';
import { ICommitAuthorRepository } from './CommitAuthorRepository';
import { Octokit } from '@octokit/rest';
import { OctokitFactory } from './OctokitFactory';
import { RepoName } from '../../domain/IRepoRepository';
import { parseISO } from 'date-fns';
Expand Down Expand Up @@ -73,7 +72,8 @@ export class WorkflowRunRepository implements IWorkflowRunRepository {
const commitAuthor = await this.commitAuthorRepo.getAuthorForCommit(
token,
repoName,
run.head_commit.id
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
run.head_commit!.id
);

if (commitAuthor) {
Expand All @@ -87,7 +87,7 @@ export class WorkflowRunRepository implements IWorkflowRunRepository {
const workflowRun: WorkflowRun = {
id: run.id.toString(),
webUrl: run.html_url,
name: run.name,
name: run.name ?? '?',
startTime: parseISO(run.created_at),
status,
finishTime: parseISO(run.updated_at),
Expand All @@ -106,22 +106,26 @@ export class WorkflowRunRepository implements IWorkflowRunRepository {
return result;
}

private getBranchKey(run: { head_branch: string; event: string }): string {
private getBranchKey(run: { head_branch: string | null; event: string }): string {
if (run.event === 'push') {
return run.head_branch;
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
return run.head_branch!;
}
if (run.event === 'pull_request') {
return `PR#${run.head_branch}`;
}
return `${run.event}#${run.head_branch}`;
}

private shouldIgnoreWorkflowRun(runStatus: string, runConclusion: string): boolean {
private shouldIgnoreWorkflowRun(runStatus: string | null, runConclusion: string | null): boolean {
// when a workflow has only skipped jobs, don't even report it.
return runStatus === 'completed' && runConclusion === 'skipped';
}

private parseWorkflowRunStatus(runStatus: string, runConclusion: string): WorkflowRunStatus {
private parseWorkflowRunStatus(
runStatus: string | null,
runConclusion: string | null
): WorkflowRunStatus {
// eslint-disable-next-line default-case
switch (runStatus) {
case 'completed':
Expand Down

0 comments on commit ecbc805

Please sign in to comment.