Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GitHub identity not set #9

Closed
lmrodriguezr opened this issue Feb 24, 2021 · 3 comments
Closed

GitHub identity not set #9

lmrodriguezr opened this issue Feb 24, 2021 · 3 comments

Comments

@lmrodriguezr
Copy link

Hello!

First off, thank you very much for this very useful action!

I'm having an issue with my repository, though. When I execute it, I'm getting this error:

rake aborted!

*** Please tell me who you are.

Run

  git config --global user.email "[email protected]"
  git config --global user.name "Your Name"

to set your account's default identity.
Omit --global to set the identity only in this repository.

fatal: unable to auto-detect email address (got 'root@524cc3ea82ce.(none)')

Tasks: TOP => release => release:source_control_push
(See full trace by running task with --trace)

(see here)

I'm passing the GITHUB_TOKEN secret, but this repository is hosted by an organization, not a user. Could that be the reason? This is the action configuration in case that helps:
https://github.com/bio-miga/miga/blob/main/.github/workflows/build.yml#L36

Thanks!

@CvX
Copy link

CvX commented Feb 26, 2021

The issue here is not with GitHub but git. 🙂

rake release is trying to create a git tag but is unable to do so when git config --global user.email and git config --global user.name are not set.

That usually is not a problem when using publish-rubygems-action since the recommended (in README) flow is to run the action on tag push – then rake release sees that the tag is already present and skips this part. 😃

You could probably work around it by adding those git commands to the workflow:

- name: Tag and deploy
  if: steps.changed-version.outputs.changed == 'true'
  uses: cadwallion/publish-rubygems-action@master
  env:
    RUBYGEMS_API_KEY: "${{ secrets.RUBYGEMS_API_KEY }}"
    GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
    RELEASE_COMMAND: |
      git config --global user.email "[email protected]"
      git config --global user.name "Automated Release"
      bundle exec rake release

lmrodriguezr added a commit to bio-miga/miga that referenced this issue Feb 26, 2021
@lmrodriguezr
Copy link
Author

Thanks a lot!!!

@CvX
Copy link

CvX commented Feb 27, 2021

@lmrodriguezr I just released a v2-beta of the Discourse fork: https://github.com/discourse/publish-rubygems-action/tree/v2-beta

It detects current gem version, checks if the matching tag exists, and if it doesn't it tags and releases the gem. 😃 (see the updated README)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants