Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add check to allow empty commits if arg is set #352

Merged
merged 4 commits into from
Jan 23, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix: target only the desired argument
  • Loading branch information
EndBug committed Jan 23, 2022
commit 3b7053b824843b9f6cec120755af26ff5525777c
2 changes: 1 addition & 1 deletion src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ core.info(`Running in ${baseDir}`)
core.info('> Checking for uncommitted changes in the git working tree...')
const changedFiles = (await git.diffSummary(['--cached'])).files.length
// continue if there are any changes or if the allow-empty commit argument is included
if (changedFiles > 0 || getInput('commit')?.includes('--allow-empty')) {
if (changedFiles > 0 || matchGitArgs(getInput('commit') || '').includes('--allow-empty')) {
core.info(`> Found ${changedFiles} changed files.`)

EndBug marked this conversation as resolved.
Show resolved Hide resolved
await git
Expand Down