Skip to content

Cannot --amend --no-edit #159

@OJFord

Description

@OJFord

I'm rendering markdown in an Action on a cron, and want it to just amend the last commit rather than create a continuous stream of 'render' commits that don't have any value.

Unfortunately though (I've tested this), this prevents --amend --no-edit from working:

commit -m "$INPUT_COMMIT_MESSAGE" \
--author="$INPUT_COMMIT_AUTHOR" \
${INPUT_COMMIT_OPTIONS:+"${INPUT_COMMIT_OPTIONS_ARRAY[@]}"};

since the --no-edit is effectively ignored if a --message is specified.

I'm not sure what to suggest as a fix, but two options I can think of are:

  1. Check if --no-edit appears in commit_options; do not specify -m .. if it does;
  2. Add an explicit with: amend: true config, which adds --amend --no-edit to options and doesn't specify -m ..

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions