Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/datadog/slapr
Add Pull Request status emojis to Slack posts.
https://github.com/datadog/slapr
emoji github-actions pull-requests slack
Last synced: 4 days ago
JSON representation
Add Pull Request status emojis to Slack posts.
- Host: GitHub
- URL: https://github.com/datadog/slapr
- Owner: DataDog
- License: apache-2.0
- Created: 2020-02-06T10:45:15.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2024-04-12T12:20:36.000Z (7 months ago)
- Last Synced: 2024-04-14T03:37:25.088Z (7 months ago)
- Topics: emoji, github-actions, pull-requests, slack
- Language: Python
- Homepage: https://github.com/DataDog/slapr
- Size: 583 KB
- Stars: 20
- Watchers: 10
- Forks: 8
- Open Issues: 10
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
README
# Slapr
Add Pull Requests status emojis to Slack posts.
On `pull_request_review` or `pull_request` events Slapr will update your slack posts with suitable emojis.
## Slack posts
Slack posts should contain the PR URL.
Examples:
- Blabla Need Review for :eyes: https://github.com/DataDog/integrations-core/pull/5746/s
- Blabla Need Review for rev https://github.com/DataDog/integrations-core/pull/5746/s## Requirements
Slack API Token with following permissions
- `channels:history`
- `reactions:read`
- `reactions:write`## Emoji status
| emoji | description |
|------------------------------|--------------------------------------------------------------|
| `SLAPR_EMOJI_REVIEW_STARTED` | The PR has at least 1 in-progress review. |
| `SLAPR_EMOJI_APPROVED` | The PR has all required approvals and is ready to be merged. |
| `SLAPR_EMOJI_NEEDS_CHANGES` | Changes are requested for the PR. |
| `SLAPR_EMOJI_COMMENTED` | A review has been submitted with comment only. |
| `SLAPR_EMOJI_MERGED` | The PR is merged. |
| `SLAPR_EMOJI_CLOSED` | The PR is closed. |## Example Usage
```yaml
name: Slack emoji PR updates
on:
pull_request_review:
types: [submitted]
pull_request:
types: [closed]jobs:
run_slapr:
runs-on: ubuntu-latest
steps:
- uses: DataDog/slapr@master
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
GITHUB_REPO: DataDog/slapr
SLACK_CHANNEL_ID: CNY5XCHAA
SLACK_API_TOKEN: "${{ secrets.SLACK_BOT_USER_OAUTH_ACCESS_TOKEN }}"
SLAPR_BOT_USER_ID: UTMS06TPX
SLAPR_NUMBER_OF_APPROVALS_REQUIRED: 2 # integer minimum=1 default=1. The number of approvals that are required for the approval emoji to be added in Slack
```## Troubleshoot
If you get the following error during Slapr run:
```
slack.errors.SlackApiError: The request to the Slack API failed.
The server responded with: {'ok': False, 'error': 'account_inactive'}
```Your `SLACK_BOT_USER_OAUTH_ACCESS_TOKEN` OAuth Token might not be valid anymore. If that's the case you should replace it with the one in `https://api.slack.com/apps/{your_app_id}/oauth`.