Skip to content

Commit 30a915e

Browse files
committed
Fixes tests etc
1 parent ab9d952 commit 30a915e

File tree

2 files changed

+20
-10
lines changed

2 files changed

+20
-10
lines changed

__tests__/util.test.ts

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@ describe('util', () => {
3232
folder: 'build',
3333
gitHubToken: null,
3434
accessToken: null,
35-
ssh: true
35+
ssh: true,
36+
silent: false
3637
}
3738
expect(generateTokenType(action)).toEqual('SSH Deploy Key')
3839
})
@@ -45,7 +46,8 @@ describe('util', () => {
4546
folder: 'build',
4647
gitHubToken: null,
4748
accessToken: '123',
48-
ssh: null
49+
ssh: null,
50+
silent: false
4951
}
5052
expect(generateTokenType(action)).toEqual('Access Token')
5153
})
@@ -58,7 +60,8 @@ describe('util', () => {
5860
folder: 'build',
5961
gitHubToken: '123',
6062
accessToken: null,
61-
ssh: null
63+
ssh: null,
64+
silent: false
6265
}
6366
expect(generateTokenType(action)).toEqual('GitHub Token')
6467
})
@@ -71,7 +74,8 @@ describe('util', () => {
7174
folder: 'build',
7275
gitHubToken: null,
7376
accessToken: null,
74-
ssh: null
77+
ssh: null,
78+
silent: false
7579
}
7680
expect(generateTokenType(action)).toEqual('…')
7781
})
@@ -87,7 +91,8 @@ describe('util', () => {
8791
folder: 'build',
8892
gitHubToken: null,
8993
accessToken: null,
90-
ssh: true
94+
ssh: true,
95+
silent: false
9196
}
9297
expect(generateRepositoryPath(action)).toEqual(
9398
'git@github.com:JamesIves/github-pages-deploy-action'
@@ -103,7 +108,8 @@ describe('util', () => {
103108
folder: 'build',
104109
gitHubToken: null,
105110
accessToken: '123',
106-
ssh: null
111+
ssh: null,
112+
silent: false
107113
}
108114
expect(generateRepositoryPath(action)).toEqual(
109115
'https://123@github.com/JamesIves/github-pages-deploy-action.git'
@@ -119,7 +125,8 @@ describe('util', () => {
119125
folder: 'build',
120126
gitHubToken: '123',
121127
accessToken: null,
122-
ssh: null
128+
ssh: null,
129+
silent: false
123130
}
124131
expect(generateRepositoryPath(action)).toEqual(
125132
'https://x-access-token:123@github.com/JamesIves/github-pages-deploy-action.git'
@@ -137,7 +144,8 @@ describe('util', () => {
137144
workspace: 'src/',
138145
folder: 'build',
139146
accessToken: 'supersecret999%%%',
140-
gitHubToken: 'anothersecret123333'
147+
gitHubToken: 'anothersecret123333',
148+
silent: false
141149
}
142150

143151
const string = `This is an error message! It contains ${action.accessToken} and ${action.gitHubToken} and ${action.repositoryPath}`
@@ -156,7 +164,8 @@ describe('util', () => {
156164
workspace: 'src/',
157165
folder: 'build',
158166
accessToken: 'supersecret999%%%',
159-
gitHubToken: 'anothersecret123333'
167+
gitHubToken: 'anothersecret123333',
168+
silent: false
160169
}
161170

162171
process.env['RUNNER_DEBUG'] = '1'

src/git.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@ export async function init(action: ActionInterface): Promise<void | Error> {
3030
await execute(`git remote rm origin`, action.workspace, action.silent)
3131
await execute(
3232
`git remote add origin ${action.repositoryPath}`,
33-
action.workspace
33+
action.workspace,
34+
action.silent
3435
)
3536
await execute(
3637
`git fetch --no-recurse-submodules`,

0 commit comments

Comments
 (0)