Input Github ID and Return Slack ID Action.
github-developer-id-mapping
String that we need for mapping from Github ID to Slack ID
Required: true
Ex) 'KanghyunJeon:UUABCDEFG,member:UuHIJKLMN' or recommended way like ${{ vars.SLACK_DEVELOPER_ID }}
github-user-id
Choice 1 / Single ID / String that we want to search from 'github-developer-id-mapping'.
Required: false
Ex) use something like ${{ github.event.pusher.name }} or Just any string value(in this case 'KanghyunJeon')
github-user-ids
Choice 2 / Multiple IDs / String that multiple reviewer's ids that we want to search from 'github-developer-id-mapping'. GitHub IDs to Slack IDs
Required: false
Ex) use something like ${{ join(github.event.pull_request.requested_reviewers.*.login, ',') }} or Just any string value(in this case 'KanghyunJeon,user1,user2')
slack-user-id
Slack User ID will be returned as mentioning type.
Ex) if there is github-user-id value in github-developer-id-mapping value, the matching Slack ID will be returned.
Like <@Slack User ID>
In this case, KanghyunJeon will return <@UUABCDEFG>
Ex) if not, 'github-user-id' will be returned.
In this case, KanghyunJeon
Ex) If github-user-ids is used, a comma-separated string of mapped IDs will be returned.
Input: github-user-ids: 'KanghyunJeon,non-existent-user'
Output: <@UUABCDEFG>,non-existent-user
Recommended Way for github-developer-id-mapping
name: Github Slack ID Mapper Action
on:
push:
branches:
- main #set whatever case you want to trigger this
jobs:
pull-request-reviewer-reminder:
runs-on: ubuntu-latest
steps:
- name: getSlackID
id: firstStepId
uses: KanghyunJeon/github-slack-id-mapper-action@v1.0.1
with:
github-developer-id-mapping: "KanghyunJeon:UUABCDEFG,member:UuHIJKLMN" # Required, need to set github repository vaiables
# ex) KanghyunJeon:UUABCDEFG,member:UuHIJKLMN' or something like ${{ vars.SLACK_DEVELOPER_ID }}
github-user-id: KanghyunJeon # Choice 1 / Single Id ex) KanghyunJeon, ${{ github.event.pusher.name }}
github-user-ids: KanghyunJeon,user1,user2 # Choice 2 / Multiple IDs ex) ${{ join(github.event.pull_request.requested_reviewers.*.login, ',') }}
- name: doOtherJobs
run: echo "SlackID = ${{ steps.firstStepId.outputs.slack-user-id }}"
# Do other works with that SlackID
KanghyunJeon