larryebaum / find-slack-user-action

GitHub Action that retrieves a Slack username for the author of the most recent commit (or provided email).

Home Page:https://github.com/scribd/find-slack-user-action

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Find Slack User Action

GitHub Action that retrieves a Slack username for the author of the most recent commit (or provided email).

Example usage

- 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/github-actions-slack@v2.2.1
  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 }}>!"

Inputs

email

Required The email to convert to slack user. Defaults to whomever pushed the last commit

slack-token

Required The Slack API token.

default-username

The username to use if the email address does not match a Slack user.

default-member-id

The member ID to use if the email address does not match a Slack user.

include-at-symbol

Include @ as a prefix to the found user. Defaults to false

Outputs

username

The retrieved Slack username.

member-id

The retrieved Slack user's member ID. This is what you'll use to mention your user:

Hey <@U024BE7LH>, thanks for submitting your report.

found-user

Boolean indicating if a matching Slack username was found.

Permissions

You'll need to provide the following permissions for the slack bot:

About

GitHub Action that retrieves a Slack username for the author of the most recent commit (or provided email).

https://github.com/scribd/find-slack-user-action

License:MIT License


Languages

Language:JavaScript 100.0%