GitHub Action that retrieves a Slack username for the author of the most recent commit (or provided email).
- name: Find Slack user
id: find-slack-user
uses: scribd/find-slack-user-action@v1
with:
slack-token: ${{ secrets.SLACK_API_TOKEN }}
- name: Print Slack user
run: echo "${{ steps.find-slack-user.outputs.username }}"
- name: Mention the user in Slack
uses: archive/[email protected]
with:
slack-function: send-message
slack-bot-user-oauth-access-token: ${{ secrets.SLACK_API_TOKEN }}
slack-channel: ABC123
slack-text: |
"Hello, <@${{ steps.find-slack-user.outputs.member-id }}>!"
Required The email to convert to slack user. Defaults to whomever pushed the last commit
Required The Slack API token.
The username to use if the email address does not match a Slack user.
The member ID to use if the email address does not match a Slack user.
Include @ as a prefix to the found user. Defaults to false
The retrieved Slack username.
The retrieved Slack user's member ID. This is what you'll use to mention your user:
Hey <@U024BE7LH>, thanks for submitting your report.
Boolean indicating if a matching Slack username was found.
You'll need to provide the following permissions for the slack bot: