Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
Metabase
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Engineering Digital Service
Metabase
Commits
5d91e6b7
Unverified
Commit
5d91e6b7
authored
1 year ago
by
Roman Abdulmanov
Committed by
GitHub
1 year ago
Browse files
Options
Downloads
Patches
Plain Diff
Slack notification about new issues (#35853)
parent
8812adc3
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
.github/workflows/team-issues-slack-notification.yml
+48
-0
48 additions, 0 deletions
.github/workflows/team-issues-slack-notification.yml
with
48 additions
and
0 deletions
.github/workflows/team-issues-slack-notification.yml
0 → 100644
+
48
−
0
View file @
5d91e6b7
name
:
Team Issues Slack Notification
on
:
issues
:
types
:
-
labeled
jobs
:
on-team-label-added
:
runs-on
:
ubuntu-22.04
timeout-minutes
:
5
if
:
|
contains(github.event.label.name, '.Team/') &&
contains(github.event.issue.labels.*.name, 'Type:Bug')
steps
:
-
name
:
Setting title
uses
:
actions/github-script@v6
id
:
vars
with
:
script
:
|
core.setOutput('issue_title', ${{ toJson(github.event.issue.title) }}.replaceAll(/"/g, '\\"'));
-
name
:
Extracting team name
id
:
team_name
run
:
|
team_label=$(sed 's/&/\$/g' <<< '${{ github.event.label.name }}')
echo $team_label
team_name=${team_label#*.Team/}
echo $team_name
echo "team_name=${team_name^^}_SLACK_ISSUES_WEBHOOK_URL" >> "$GITHUB_OUTPUT"
-
name
:
Send the issue ${{ github.event.issue.number }} to Slack
id
:
slack
uses
:
slackapi/slack-github-action@v1.23.0
with
:
payload
:
|
{
"blocks": [
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "${{ steps.vars.outputs.issue_title }}\n${{ github.event.issue.html_url }}"
}
}
]
}
env
:
SLACK_WEBHOOK_URL
:
${{ secrets[steps.team_name.outputs.team_name] }}
SLACK_WEBHOOK_TYPE
:
INCOMING_WEBHOOK
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment