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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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
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