Skip to content

Commit cc9bf0b

Browse files
Merge pull request #410 from technote-space/release/next-v5.3.2
release: v5.3.3
2 parents 6f1014a + 113153d commit cc9bf0b

File tree

8 files changed

+28
-28
lines changed

8 files changed

+28
-28
lines changed

.eslintrc

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,8 @@
109109
"sort-imports": 0,
110110
"import/order": [2, {
111111
"groups": ["type", "builtin", "external", "internal", "parent", "sibling", "index", "object"],
112-
"alphabetize": { "order": "asc", "caseInsensitive": true },
113-
}]
112+
"alphabetize": { "order": "asc", "caseInsensitive": true }
113+
}],
114+
"@typescript-eslint/no-non-null-assertion": "off"
114115
}
115116
}

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@technote-space/github-action-helper",
3-
"version": "5.3.2",
3+
"version": "5.3.3",
44
"description": "Helper for GitHub Action.",
55
"keywords": [
66
"github",
@@ -44,7 +44,7 @@
4444
"@actions/github": "^5.0.1",
4545
"@octokit/openapi-types": "^11.2.0",
4646
"@octokit/plugin-rest-endpoint-methods": "^5.13.0",
47-
"@technote-space/github-action-log-helper": "^0.2.1",
47+
"@technote-space/github-action-log-helper": "^0.2.2",
4848
"shell-escape": "^0.2.0",
4949
"sprintf-js": "^1.1.2"
5050
},
@@ -53,7 +53,7 @@
5353
"@commitlint/config-conventional": "^16.2.1",
5454
"@rollup/plugin-typescript": "^8.3.2",
5555
"@sindresorhus/tsconfig": "^2.0.0",
56-
"@technote-space/github-action-test-helper": "^0.9.2",
56+
"@technote-space/github-action-test-helper": "^0.9.3",
5757
"@types/node": "^17.0.25",
5858
"@types/shell-escape": "^0.2.0",
5959
"@typescript-eslint/eslint-plugin": "^5.20.0",

src/api-helper.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ export default class ApiHelper {
122122
}));
123123
}
124124

125-
return this.prCache[key];
125+
return this.prCache[key]!;
126126
};
127127

128128
public filesToBlobs = async(rootDir: string, files: Array<string>): Promise<Array<{ path: string; sha: string }>> => await Promise.all(files.map(file => this.createBlob(rootDir, file)));
@@ -198,7 +198,7 @@ export default class ApiHelper {
198198
head: `${this.context.repo.owner}:${getBranch(branchName, false)}`,
199199
});
200200
if (response.data.length) {
201-
return response.data[0];
201+
return response.data[0]!;
202202
}
203203

204204
return null;

src/git-helper.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* eslint-disable no-magic-numbers */
2-
import { ExecException } from 'child_process';
3-
import { Context } from '@actions/github/lib/context';
2+
import type { Context } from '@actions/github/lib/context';
3+
import type { ExecException } from 'child_process';
44
import { Logger } from '@technote-space/github-action-log-helper';
55
import {
66
testEnv,

src/git-helper.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ export default class GitHelper {
130130
args: ['--abbrev-ref', 'HEAD'],
131131
suppressError: this.shouldSuppressError(),
132132
stderrToStdout: true,
133-
}))[0].stdout[0]?.trim() ?? '';
133+
}))[0]!.stdout[0]?.trim() ?? '';
134134
};
135135

136136
public cloneBranch = async(workDir: string, branch: string, context: Context): Promise<void> => {
@@ -271,7 +271,7 @@ export default class GitHelper {
271271
command: 'git status',
272272
args: ['--short', '-uno'],
273273
suppressOutput: true,
274-
}))[0].stdout.filter(line => line.match(/^[MDA]\s+/)).filter(this.filter).map(line => line.replace(/^[MDA]\s+/, ''));
274+
}))[0]!.stdout.filter(line => line.match(/^[MDA]\s+/)).filter(this.filter).map(line => line.replace(/^[MDA]\s+/, ''));
275275

276276
public getRefDiff = async(workDir: string, baseRef: string, compareRef: string, diffFilter?: string, dot?: '..' | '...'): Promise<string[]> => {
277277
const toDiffRef = (ref: string): string =>
@@ -282,7 +282,7 @@ export default class GitHelper {
282282
command: 'git diff',
283283
args: [`${toDiffRef(baseRef)}${dot ?? '...'}${toDiffRef(compareRef)}`, '--name-only', diffFilter ? `--diff-filter=${diffFilter}` : ''],
284284
suppressOutput: true,
285-
}))[0].stdout.filter(item => !!item.trim());
285+
}))[0]!.stdout.filter(item => !!item.trim());
286286
};
287287

288288
public checkDiff = async(workDir: string): Promise<boolean> => !!(await this.getDiff(workDir)).length;
@@ -320,7 +320,7 @@ export default class GitHelper {
320320
command: 'git tag',
321321
suppressOutput: options?.suppressOutput || options?.quiet,
322322
altCommand: options?.quiet ? '' : undefined,
323-
}))[0].stdout;
323+
}))[0]!.stdout;
324324

325325
public fetchTags = async(workDir: string, context: Context, splitSize = 20): Promise<void> => { // eslint-disable-line no-magic-numbers
326326
await this.runCommand(workDir, [

src/utils.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ export const parseVersion = (version: string, options?: { fill?: boolean; cut?:
4646
return undefined;
4747
}
4848

49-
const fragments = split(matches[1], '.');
49+
const fragments = split(matches[1]!, '.');
5050
// eslint-disable-next-line no-magic-numbers
5151
const length = options?.slice && options.slice < 0 ? (options.length ?? 3) : (options?.slice ?? options?.length ?? 3);
5252
// eslint-disable-next-line no-magic-numbers
@@ -220,7 +220,7 @@ export const versionCompare = (version1: string, version2: string, checkDifferen
220220
const val1 = version1[num] ?? (checkDifferentLevel ? 0 : version2[num]);
221221
// eslint-disable-next-line no-magic-numbers
222222
const val2 = version2[num] ?? (checkDifferentLevel ? 0 : version1[num]);
223-
return val1 === val2 ? compare(version1, version2, ++num) : Math.sign(val1 - val2);
223+
return val1 === val2 ? compare(version1, version2, ++num) : Math.sign(val1! - val2!);
224224
};
225225
return compare(splitVersion(version1.replace(/^v/, '')), splitVersion(version2.replace(/^v/, '')));
226226
};
@@ -261,17 +261,17 @@ export const isOutputDebug = (): boolean => getInput('UTILS_OUTPUT_DEBUG') === '
261261
export const objectGet = <T>(value: Record<string, any> | undefined | null, key: string, defaultValue?: T): T | undefined => {
262262
const keys = key.split('.');
263263

264-
if (!keys.length || !value || !(keys[0] in value)) {
264+
if (!keys.length || !value || !(keys[0]! in value)) {
265265
return defaultValue;
266266
}
267267

268268
// eslint-disable-next-line no-magic-numbers
269269
if (keys.length > 1) {
270270
// eslint-disable-next-line no-magic-numbers
271-
return objectGet(value[keys[0]], keys.slice(1).join('.'), defaultValue);
271+
return objectGet(value[keys[0]!], keys.slice(1).join('.'), defaultValue);
272272
}
273273

274-
return value[keys[0]];
274+
return value[keys[0]!];
275275
};
276276

277277
export const ensureNotNullValue = <T>(value: T | null | undefined, defaultValue: T): T => value ?? defaultValue;

tsconfig.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@
77
"es2020"
88
],
99
"noPropertyAccessFromIndexSignature": false,
10-
"noImplicitAny": false,
11-
"strictNullChecks": false
10+
"noImplicitAny": false
1211
},
1312
"include": [
1413
"src"

yarn.lock

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -379,18 +379,18 @@
379379
resolved "https://registry.yarnpkg.com/@sindresorhus/tsconfig/-/tsconfig-2.0.0.tgz#610e1cb8ed4e1cb7ff0cb4cb8712cd607315c152"
380380
integrity sha512-1nsyWtFtPpVjEnNzp2rd03BVz84BYHeW7LNYvmcj3q4jAgJL2hl0XBp3WmDFFPjFLF3w+L0XEYqhjWUTU+TCzw==
381381

382-
"@technote-space/github-action-log-helper@^0.2.1":
383-
version "0.2.1"
384-
resolved "https://registry.yarnpkg.com/@technote-space/github-action-log-helper/-/github-action-log-helper-0.2.1.tgz#5319d9f13add3bbaa75be9c1422cf9c986655b9f"
385-
integrity sha512-IakrjNmMiaYKOcrk/id+oqvGzGXofcIYlpCUngyzOyVrsXCd2o7b/8eTSHAknGg8o82lN6KLW99Su9iIJye3hg==
382+
"@technote-space/github-action-log-helper@^0.2.2":
383+
version "0.2.2"
384+
resolved "https://registry.yarnpkg.com/@technote-space/github-action-log-helper/-/github-action-log-helper-0.2.2.tgz#90bf784372a4af0fb720778b81c3b75de9b5cafa"
385+
integrity sha512-5jHDxczTLgC4tCJ8Xc7+g1l3N1rEjfogYJiYMUA16a0okD27x9Ymq6pnlDsV6zfsq6bTlTBEHFWLFJgjVKkZpg==
386386
dependencies:
387387
"@actions/core" "^1.6.0"
388388
sprintf-js "^1.1.2"
389389

390-
"@technote-space/github-action-test-helper@^0.9.2":
391-
version "0.9.2"
392-
resolved "https://registry.yarnpkg.com/@technote-space/github-action-test-helper/-/github-action-test-helper-0.9.2.tgz#8721f18658136f3c8ce27819940293d0847daec5"
393-
integrity sha512-2kuw9cvI+sn768OAAtkIVZoPOqPZUptvsMlEURkG6mFWCtifzY0Qj52rzX9vuJWLEuwRu6JSldBiJnjepXmATQ==
390+
"@technote-space/github-action-test-helper@^0.9.3":
391+
version "0.9.3"
392+
resolved "https://registry.yarnpkg.com/@technote-space/github-action-test-helper/-/github-action-test-helper-0.9.3.tgz#b7e4e3bce6ebd0543000740ac297947e44de8b68"
393+
integrity sha512-8h97sKU9rNteyErnzfTimnUifVE6SFa3HebzPWWeEIjt7KPPFCXrSaAIx1o+4Es1In46oOLZQRJOK1fwSKEaYg==
394394
dependencies:
395395
"@actions/core" "^1.6.0"
396396
"@actions/github" "^5.0.1"

0 commit comments

Comments
 (0)