Skip to content

Unable to get current release by commits in Github Actions #560

Closed

Description

@sp-ivan-alcoceba

The problem

Since a few days ago we have multiple repositories where the Github Action is failing, resolving an empty SHA while doing the action and returning an error.
We tried to re-run an old job, which worked correctly and now it is failing with the same error.

Doing the action, calling directly the library with:

python -m semantic_release publish -v DEBUG -D commit_author="github-actions <[email protected]>"

is iterating through all the commits and returning the proper version.

Expected behavior

Expected behavior is for when semantic release runs, for it to be able to find the version in the commit.

Additional context

Log:

debug: get_current_version_by_config_file()
debug: Regex matched version: 0.0.1
debug: get_current_version_by_config_file -> 0.0.1
debug: get_current_release_version_by_commits()
error: SHA could not be resolved, git returned: b''
##[debug]Docker Action run completed with exit code 1
##[debug]Finishing: Python Semantic Release

Activity

  1. added
    bug
    on Feb 22, 2023
  2. luchinke commented on Feb 22, 2023

    @luchinke

    Also happening to me. The only thing i could see that changed is the version of GitPython. (from 3.1.30 to 3.1.31)

  3. bernardcooke53 commented on Feb 24, 2023

    @bernardcooke53
    Contributor

    This is going to be really difficult to debug without an environment to reproduce the issue in, as it might be dependent on specific properties of commits - is there a public example or some steps I could use to reproduce this myself?

  4. madpah commented on Feb 27, 2023

    @madpah
  5. bernardcooke53 commented on Feb 27, 2023

    @bernardcooke53
    Contributor

    @madpah thank you for sharing - super helpful. I noticed you're running relekang/[email protected] in the pipeline which is failing - there was a patch in v7.33.1 which changed some git configuration in the Docker container used for the GitHub action (2a55fc8) to account for the recent security patches to Git; looking at this GitPython issue I think it's a good idea to rule that out first - would you mind bumping to v7.33.2 (and changing to reference python-semantic-release/python-semantic-release) and seeing if that resolves it?

    On the basis of the above - @sp-ivan-alcoceba + @luchinke could you also check/update the version of python-semantic-release you are using please?

  6. sp-ivan-alcoceba commented on Feb 28, 2023

    @sp-ivan-alcoceba
    Author

    Thanks for sharing @madpah as we didn't have any public repository to be shared. Look forward to seeing if that works.

  7. CaibinSh commented on Mar 1, 2023

    @CaibinSh

    I also got this problem. Following @bernardcooke53 's suggestion on updating python-semantic-release to v7.33.2, the issue is resolved. Thanks

  8. madpah commented on Mar 2, 2023

    @madpah

    @bernardcooke53 - v7.33.2 definitely seems to resolve the issue reported.

    I hit a bunch of other unrelated things now - but thanks for the time and support!

  9. sp-ivan-alcoceba commented on Mar 3, 2023

    @sp-ivan-alcoceba
    Author
  10. luchinke commented on Mar 3, 2023

    @luchinke

    v7.33.2 also worked for me! 🚀

  11. InterferencePattern commented on Jul 10, 2023

    @InterferencePattern

    I'm seeing this error: SHA could not be resolved, git returned: b'' error when using Jenkins as well, using semantic release v7.34.6, but downgrading to v7.33.2 hasn't made a difference.
    This was also the case whether the version of gitpython was 3.1.31 or 3.1.30.

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

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions