Skip to content

Commit

Permalink
Merge pull request #128 from losisin/fix-git-add-file
Browse files Browse the repository at this point in the history
fix git add outputFile
  • Loading branch information
losisin authored Mar 26, 2024
2 parents cc40963 + 7caf5f5 commit 5cd6bae
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions __tests__/main.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ describe('run function', () => {

const gitMock: jest.Mocked<SimpleGit> = {
status: jest.fn().mockResolvedValue({
files: [{ path: './**/README.md' }]
files: [{ path: './README.md' }]
}),
addConfig: jest.fn().mockResolvedValue(undefined),
add: jest.fn().mockResolvedValue(undefined),
Expand Down Expand Up @@ -145,7 +145,7 @@ describe('run function', () => {
'user.email',
'user@email.com'
)
expect(gitMock.add).toHaveBeenCalledWith(['./**/README.md'])
expect(gitMock.add).toHaveBeenCalledWith(['./README.md'])
expect(gitMock.commit).toHaveBeenCalledWith('message')
expect(gitMock.push).toHaveBeenCalledTimes(1)
expect(setOutputMock).toHaveBeenCalledWith('helm-docs', '/mocked/path')
Expand Down
2 changes: 1 addition & 1 deletion dist/index.js

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

2 changes: 1 addition & 1 deletion src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export async function run(): Promise<void> {
case gitPush === 'true':
await git.addConfig('user.name', gitPushUserName)
await git.addConfig('user.email', gitPushUserEmail)
await git.add([`${chartSearchRoot}/**/${outputFile}`])
await git.add([`${chartSearchRoot}/${outputFile}`])
await git.commit(gitCommitMessage)
await git.push()
core.info(`Pushed '${outputFile}' to the branch.`)
Expand Down

0 comments on commit 5cd6bae

Please sign in to comment.