Skip to content

Using --amend as commit_options doesn't work when working directory is clean  #82

@goetzc

Description

@goetzc

Hello, thanks for this Action. I'm experiencing some kind of unexpected behavior when using the --amend Git option, which I'm describing below.

Version of the Action
v4.3.0

Describe the bug
When using the --amend Git commit option on the commit_options field, the Action doesn't work if the working directory is clean, showing the message "Working tree clean. Nothing to commit.".

To Reproduce
Steps to reproduce the behavior:

  • Use the --amend option on the commit_options field.
  • When the working directory is empty, nothing is changed.

Expected behavior
The commit should be amended and pushed.

Used Workflow

# Some previews manual Git changes …

    - name: Commit changes
      uses: stefanzweifel/[email protected]
      with:
        commit_message: Bump version to ${{ steps.git-version.outputs.tag }}
        commit_options: --amend  # <-- This is 
        tagging_message: ${{ steps.git-version.outputs.tag }}

Additional context
My purpose is to perform some Git operations generating a new commit, and finally using this action and the --amend option to modify the commit and push it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions