Skip to content

v7.33.2 unable to detect commit author - regression? #566

Closed

Description

@madpah

The problem

After working around #560 by upgrading to v7.33.2, I have a number of projects that are now failing to publish back to GitHub (breaking semantic-release publish).

Example project: https://github.com/madpah/serializable

What I've tried

  1. Reverted from the GitHub Action to plain python-semantic-version installation (https://github.com/madpah/serializable/actions/runs/4321618771)
Current version: 0.10.1, Current release version: 0.10.1
Bumping with a minor version to 0.11.0
error: Cmd('git') failed due to: exit code(128)
error:   cmdline: git commit -m 0.11.0
error: 
error: Automatically generated by python-semantic-release --author=semantic-release <semantic-release>
error:   stderr: 'Committer identity unknown
error: 
error: *** Please tell me who you are.
error: 
error: Run
error: 
error:   git config --global user.email "[email protected]"
error:   git config --global user.name "Your Name"
error: 
error: to set your account's default identity.
error: Omit --global to set the identity only in this repository.
error: 
error: fatal: empty ident name (for <[email protected][23](https://github.com/madpah/serializable/actions/runs/4321870889/jobs/7543605922#step:8:24)byketeyxppypgmqpve.phxx.internal.cloudapp.net>) not allowed'
  1. Explicitly set commit_author (https://github.com/madpah/serializable/actions/runs/4322001835)
error: Cmd('git') failed due to: exit code(128)
error:   cmdline: git commit -m 0.11.0
error: 
error: Automatically generated by python-semantic-release --author=github-actions <[email protected]>
error:   stderr: 'Committer identity unknown
error: 
error: *** Please tell me who you are.
error: 
error: Run
error: 
error:   git config --global user.email "[email protected]"
error:   git config --global user.name "Your Name"
error: 
error: to set your account's default identity.
error: Omit --global to set the identity only in this repository.
error: 
error: fatal: empty ident name (for <runner@fv-az566-152.iltkdbwcmizurjtzn42pmpc1mg.bx.internal.cloudapp.net>) not allowed'

I've never had to set or define commit_author previously.

Any advice / help appreciated.

Activity

  1. added
    bugSomething isn't working properly
    on Mar 3, 2023
  2. bernardcooke53 commented on Mar 3, 2023

    @bernardcooke53
    Contributor

    Hey @madpah , I can see that py-serializable==0.11.1 was released a couple of hours ago! 🚀

    Looking at the workflows you mentioned, I think the problem was this:
    poetry not found is an issue we've seen before - if you change your build_command to pip install poetry && poetry build you should be good to go - Python Semantic Release runs in its own virtual environment so you need to make sure poetry is installed in there with it. However the other workflow failures you linked concerned me, so I took a look into those too, and I think this is why:

    When using our GitHub action, git is configured to use the input commit author with the git command line. By pulling the python-semantic-release package in directly, you will be running it without those git configuration steps - and if you use author=... git still checks for the existence of your configuration file before performing the commit. I happen to know because I hit exactly the same bug while working on v8, there's a reference to it at #487.

    The fix is to setup environment variables for git - here's a working example which seems to work around the issue, i.e. git seems to respect these environment variables regardless of the presence of a config file or not.
    Also, these are set with the command line in the GitHub action.

    I am unfortunately not likely to be near a keyboard for the next week, so I'd advise if you (or anyone else) wants to run Python Semantic Release outside of the GitHub action, you can try working around this by running those git config commands in the action with the author and email you want and/or set those GIT_* environment variables.

    Hope this helps!

  3. madpah commented on Mar 7, 2023

    @madpah
    Author

    Thanks for the comprehensive response @bernardcooke53.

    I made changes as suggested and it worked (https://github.com/madpah/serializable/actions/runs/4353000193/jobs/7606491536).

    However, this means I need to pin the version of poetry in my pyproject.toml which makes me sad :-(

    If you are not aware of a workaround, perhaps a feature request to allow dependencies to be specified when using the GitHub Action is appropriate?

  4. bernardcooke53 commented on Mar 14, 2023

    @bernardcooke53
    Contributor

    Hey @madpah - I don't know of a better way other than inlining the dependency specification, so that sounds useful 👍

  5. github-actions commented on Mar 26, 2024

    @github-actions

    This issue is stale because it has not been confirmed or planned by the maintainers and has been open 90 days with no recent activity. It will be closed in 7 days, if no further activity occurs. Thank you for your contributions.

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

    bugSomething isn't working properlystale

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions