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
Show file tree
Hide file tree
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
Next Next commit
add check to allow empty commits if arg is set
  • Loading branch information
mcargille committed Jan 21, 2022
commit 234dc9116f6b9f2d676a446b86dccd8f7e868e3e
4 changes: 2 additions & 2 deletions lib/index.js

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ core.info(`Running in ${baseDir}`)

core.info('> Checking for uncommitted changes in the git working tree...')
const changedFiles = (await git.diffSummary(['--cached'])).files.length
if (changedFiles > 0) {
// continue if there are any changes or if the allow-empty commit argument is included
if (changedFiles > 0 || getInput('commit')?.includes('--allow-empty')) {
EndBug marked this conversation as resolved.
Show resolved Hide resolved
core.info(`> Found ${changedFiles} changed files.`)

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