Skip to content

Allow-Empty commit argument not working #350

Closed
@mcargille

Description

@mcargille

Describe the bug
I am attempting to use the new commit arguments option to create an empty commit by passing in '--allow-empty'. The logs show that it is correctly evaluated as an input. The precise commit command does not seem to be printed by even detailed debug logs, but the internal logs show the normal 'Working tree clean. Nothing to commit.' message, indicating the argument was not executed.

Workflow used

- uses: EndBug/add-and-commit@v8.0.0
  with:
    commit: '--allow-empty'
    message: 'closes #${{ github.event.issue.number }}'
    new_branch: '#${{ github.event.issue.number }}-${{ github.event.issue.title }}'

Expected behavior
Expected the 'commit: --allow-empty' option to be passed to the commit command and successfully create an empty commit.

Logs
##[debug]Evaluating condition for step: 'Run EndBug/add-and-commit@v8.0.0'
##[debug]Evaluating: success()
##[debug]Evaluating success:
##[debug]=> true
##[debug]Result: true
##[debug]Starting: Run EndBug/add-and-commit@v8.0.0
##[debug]Loading inputs
##[debug]Evaluating: format('closes #{0}', github.event.issue.number)
##[debug]Evaluating format:
##[debug]..Evaluating String:
##[debug]..=> 'closes #{0}'
##[debug]..Evaluating Index:
##[debug]....Evaluating Index:
##[debug]......Evaluating Index:
##[debug]........Evaluating github:
##[debug]........=> Object
##[debug]........Evaluating String:
##[debug]........=> 'event'
##[debug]......=> Object
##[debug]......Evaluating String:
##[debug]......=> 'issue'
##[debug]....=> Object
##[debug]....Evaluating String:
##[debug]....=> 'number'
##[debug]..=> 16
##[debug]=> 'closes #16'
##[debug]Result: 'closes #16'
##[debug]Evaluating: format('#{0}-{1}', github.event.issue.number, github.event.issue.title)
##[debug]Evaluating format:
##[debug]..Evaluating String:
##[debug]..=> '#{0}-{1}'
##[debug]..Evaluating Index:
##[debug]....Evaluating Index:
##[debug]......Evaluating Index:
##[debug]........Evaluating github:
##[debug]........=> Object
##[debug]........Evaluating String:
##[debug]........=> 'event'
##[debug]......=> Object
##[debug]......Evaluating String:
##[debug]......=> 'issue'
##[debug]....=> Object
##[debug]....Evaluating String:
##[debug]....=> 'number'
##[debug]..=> 16
##[debug]..Evaluating Index:
##[debug]....Evaluating Index:
##[debug]......Evaluating Index:
##[debug]........Evaluating github:
##[debug]........=> Object
##[debug]........Evaluating String:
##[debug]........=> 'event'
##[debug]......=> Object
##[debug]......Evaluating String:
##[debug]......=> 'issue'
##[debug]....=> Object
##[debug]....Evaluating String:
##[debug]....=> 'title'
##[debug]..=> 'test'
##[debug]=> '#16-test'
##[debug]Result: '#16-test'
##[debug]Evaluating: github.token
##[debug]Evaluating Index:
##[debug]..Evaluating github:
##[debug]..=> Object
##[debug]..Evaluating String:
##[debug]..=> 'token'
##[debug]=> '***'
##[debug]Result: '***'
##[debug]Loading env
Run EndBug/add-and-commit@v8.0.0
  with:
    commit: --allow-empty
    message: closes #16
    new_branch: #16-test
    add: .
    cwd: .
    default_author: github_actor
    pathspec_error_handling: ignore
    push: true
    github_token: ***

::set-output name=committed::false
##[debug]='false'

::set-output name=commit_long_sha::
##[debug]=''

::set-output name=commit_sha::
##[debug]=''

::set-output name=pushed::false
##[debug]='false'

::set-output name=tagged::false
##[debug]='false'
Running in /home/runner/work/taskchain/taskchain
##[debug]Input parsed as single string
Add input parsed as single string, running 1 git add command.

Using 'mcargille mcargille@users.noreply.github.com' as author.
##[debug]Committer: mcargille mcargille@users.noreply.github.com
Using "closes #16" as commit message.
##[debug]Current push option: 'true' (parsed as boolean)
::group::Internal logs
Internal logs
Staging files...
Adding files...
##[debug]Input parsed as single string
##[debug]Git args parsed:
##[debug] - Original: .
##[debug] - Parsed: ["."]
No files to remove.
Checking for uncommitted changes in the git working tree...
::endgroup::
Working tree clean. Nothing to commit.
::group::Outputs
Outputs
committed: false
commit_long_sha: undefined
commit_sha: undefined
pushed: false
tagged: false
::endgroup::
##[debug]Node Action run completed with exit code 0
##[debug]Finishing: Run EndBug/add-and-commit@v8.0.0

Metadata

Metadata

Assignees

Labels

good first issueGood for newcomerstype: bugVerified problems that need to be worked on

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions