Skip to content

Commit 429e5e2

Browse files
Merge pull request #248 from technote-space/release/v1.1.9
Release/v1.1.9
2 parents a2e3d6d + 54ed2d1 commit 429e5e2

File tree

3 files changed

+13
-4
lines changed

3 files changed

+13
-4
lines changed

__tests__/utils.test.ts

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { Utils } from '../src';
66
const {getWorkspace, getActor, escapeRegExp, getRegExp, getPrefixRegExp, getSuffixRegExp, useNpm, versionCompare, getOctokit} = Utils;
77
const {isSemanticVersioningTagName, isPrRef, getPrMergeRef, getBoolValue, replaceAll, getPrHeadRef, arrayChunk, sleep} = Utils;
88
const {getBranch, getRefForUpdate, uniqueArray, getBuildInfo, split, getArrayInput, generateNewPatchVersion, getPrBranch} = Utils;
9-
const {isBranch, isTagRef, normalizeRef, trimRef, getTag, getRefspec, getRemoteRefspec, getLocalRefspec, mask} = Utils;
9+
const {isBranch, isTagRef, normalizeRef, trimRef, getTag, getRefspec, getRemoteRefspec, getLocalRefspec, mask} = Utils;
1010

1111
jest.useFakeTimers();
1212

@@ -552,6 +552,15 @@ describe('getLocalRefspec', () => {
552552
describe('mask', () => {
553553
it('should remove token', () => {
554554
expect(mask({})).toEqual({});
555+
expect(mask({
556+
token: 'test',
557+
test1: null,
558+
test2: undefined,
559+
})).toEqual({
560+
token: '***',
561+
test1: null,
562+
test2: undefined,
563+
});
555564
expect(mask({
556565
test1: {
557566
token: 'test',
@@ -563,7 +572,7 @@ describe('mask', () => {
563572
},
564573
})).toEqual({
565574
test1: {
566-
token: '***'
575+
token: '***',
567576
},
568577
test2: 2,
569578
test3: {

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@technote-space/github-action-helper",
3-
"version": "1.1.8",
3+
"version": "1.1.9",
44
"description": "Helper to filter GitHub Action.",
55
"author": {
66
"name": "Technote",

src/utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ export const versionCompare = (version1: string, version2: string, checkDifferen
170170

171171
export const mask = (value: object, target = 'token'): object => {
172172
Object.keys(value).forEach(key => {
173-
if (typeof value[key] === 'object') {
173+
if (value[key] && typeof value[key] === 'object') {
174174
value[key] = mask(value[key], target);
175175
} else if (target === key) {
176176
value[key] = '***';

0 commit comments

Comments
 (0)