You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was able to do this in Jenkins, and looking for a way to do it in GHA. I need a way to lookup a slack user's username via their email.
Github actions give context on the committer via email, but obv github doesn't provide slack user data. In order to tag a user directly, being able to lookup the user's slack id so you can tag them or message them directly would be incredibly valuable.
What type of issue is this? (place an x in one of the [ ])
bug
enhancement (feature request)
question
documentation related
example code related
testing related
discussion
Requirements (place an x in each of the [ ])
I've read and understood the Contributing guidelines and have done my best effort to follow them.
Thanks for the posting the question - it's a pretty common use-case to try to look up a user based on their email address and totally makes sense that you'd need to do this from our GitHub Action.
Since you've done this in Jenkins, I imagine you're already aware of the Slack API method users.lookupByEmail?
We don't have a slick way of calling this method from the GitHub Action, but we're playing around with a few ideas for you. Hopefully, together we can find a solution for you until slack-github-action@v2 (branch) lands! Expect a follow-up response soon!
@thejeff77 adding to the suggestion of using the users.lookupByEmail method, it should be possible to make this call with a curl request and scoped token like so:
- name: Find the Slackbot user IDrun: | curl -X POST -H "Authorization: Bearer ${{ secrets.SLACK_BOT_TOKEN }}" \ -H "Content-type: application/json" \ --data '{"email":"[email protected]"}' \ https://slack.com/api/users.lookupByEmail
Although making use of the response might require a bit of bash magic in this step...
As @mwbrooks mentioned, we're chipping away at @v2 of this GitHub Action which will have more support for calling Slack API methods and making use of these responses in later steps.
We'll check that this method works well in these updates and will continue to share updates with changes for that version!
Description
I was able to do this in Jenkins, and looking for a way to do it in GHA. I need a way to lookup a slack user's username via their email.
Github actions give context on the committer via email, but obv github doesn't provide slack user data. In order to tag a user directly, being able to lookup the user's slack id so you can tag them or message them directly would be incredibly valuable.
What type of issue is this? (place an
x
in one of the[ ]
)Requirements (place an
x
in each of the[ ]
)Bug Report
Filling out the following details about bugs will help us solve your issue sooner.
Reproducible in:
package version:
node version:
OS version(s):
Steps to reproduce:
Expected result:
What you expected to happen
Actual result:
What actually happened
Attachments:
Logs, screenshots, screencast, sample project, funny gif, etc.
The text was updated successfully, but these errors were encountered: