actions / create-github-app-token

GitHub Action for creating a GitHub App Installation Access Token
https://github.com/marketplace/actions/create-github-app-token
MIT License
321 stars 46 forks source link

[Feature Request] Add GitHub App user name and email in outputs. #114

Closed huxuan closed 4 months ago

huxuan commented 4 months ago

According to the discussion here: https://github.com/orgs/community/discussions/24664, sometimes, we want to know the GitHub App's user name and user id (for the corresponding email address), it would be great if we can have those in the outputs.

gr2m commented 4 months ago

Hi Xuan, we already export app-slug, see outputs.

In order to get the user ID of an app, an additional request needs to be sent. As that is not a common enough use case, I suggest we update the README to show how to do it.

Say outputs.app-slug is my-app, then the user name is my-app[bot]. With that you can retrieve the user ID at GET /users/{login}.

gr2m commented 4 months ago

Actually it might suffice to just do my-app[bot]@users.noreply.github.com as the git email, without the need of adding the user ID of the app, can you give that a try?

huxuan commented 4 months ago

Great, I will try it soon. Thanks for the information.

huxuan commented 4 months ago

It works like a charm! Thanks again and close the issue now.