Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add dot-org slack worfklow template #13314

Merged
merged 5 commits into from
Dec 27, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions .github/workflows/dot-org-filter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# This workflow sends a notification to Slack when an issue labeled 'type-bug' is opened, edited, or labeled and the 'Anaconda.org' checkbox is checked in the issue description.

name: Anaconda.org Issues Notification to Slack

on:
issues:
types: [opened, edited, labeled]

jobs:
check-conditions:
if: contains(github.event.issue.labels.*.name, 'type-bug')
runs-on:
labels: ubuntu-latest
outputs:
should-notify: ${{ steps.filter.outputs.should-notify }}
steps:
- name: Check if "Anaconda.org" checkbox is checked
id: filter
run: lazy-actions/slatify@master
body="${{ github.event.issue.body }}"
search_term="- [x] Anaconda.org"

if echo "$body" | grep -Fxq "$search_term"; then
echo "::set-output name=should-notify::true"
else
echo "::set-output name=should-notify::false"
fi

notify-slack:
if: needs.check-conditions.outputs.should-notify == 'true'
runs-on:
labels: ubuntu-latest
needs: [check-conditions]
steps:
- name: Send message to Slack
uses:
env:
# Tokens and url for test notifications
SLACK_WEBHOOK_URL: ${{ secrets.DOT_ORG_SLACK_WEBHOOK_URL }}
SLACK_CHANNEL_ID: ${{ secrets.DOT_ORG_SLACK_CHANNEL_ID }}
SLACK_TITLE: "Issue with 'type-bug' label Detected"
SLACK_MESSAGE: "Title: ${{ github.event.issue.title }} - URL: ${{ github.event.issue.html_url }} - 'Test.org' checked"
SLACK_COLOR: "#a6368d"