Skip to content

Fails to extract base commit on non-PR pushes. #14

Description

@niyarin

It doesn't seem to work when pushing directly to the main branch.
The causes seem to be as follows:

  1. This line (
    BASE_NEXT_HASH=$(git log $BRANCH_NAME --not `git for-each-ref --format='%(refname)' refs |grep -v /$BRANCH_NAME$ ` --pretty=format:"%H"|tail -n 1)
    ) extracts the first commit that excludes commits only present in the branch to be merged.
  2. This line is also executed when a commit is made directly to the main branch.
  • One possible solution is to set BASE_NEXT_HASH to the previous commit if it's empty.
  • Additionally, it might be worth updating the branch name check to include both master and main.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions