Skip to content

Commit 83abf6c

Browse files
authored
Merge pull request #37 from mxenabled/mc/slack_notifications
Slack notifications [skip actions]
2 parents b0a0f8f + 99ddf96 commit 83abf6c

File tree

5 files changed

+92
-5
lines changed

5 files changed

+92
-5
lines changed

.github/workflows/generate.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,3 +52,15 @@ jobs:
5252
run: gh pr create -f
5353
env:
5454
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
55+
- name: Slack notification
56+
uses: ravsamhq/notify-slack-action@v2
57+
if: always()
58+
with:
59+
status: ${{ job.status }}
60+
token: ${{ secrets.GITHUB_TOKEN }}
61+
notification_title: "{repo}: {workflow} workflow"
62+
message_format: "{emoji} *{workflow}* {status_message} in <{repo_url}|{repo}>"
63+
footer: "<{workflow_url}|View Workflow>"
64+
notify_when: "failure"
65+
env:
66+
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}

.github/workflows/generate_publish_release.yml

Lines changed: 36 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,8 @@ jobs:
1616
- name: Bump version
1717
id: bump_version
1818
run: echo "::set-output name=version::$(ruby .github/version.rb ${{ github.event.client_payload.version }})"
19-
2019
- name: Clean repo
2120
run: ruby .github/clean.rb
22-
2321
- name: Install openapi-generator-cli
2422
run: |
2523
npm install @openapitools/openapi-generator-cli -g
@@ -30,10 +28,8 @@ jobs:
3028
-g python \
3129
-c ./openapi/config.yml \
3230
-t ./openapi/templates
33-
3431
- name: Checkout master
3532
run: git checkout master
36-
3733
- name: Create commit
3834
run: |
3935
git config user.name "devexperience"
@@ -42,11 +38,22 @@ jobs:
4238
git commit -m "Generated version ${{ steps.bump_version.outputs.version }}
4339
4440
This commit was automatically created by a GitHub Action to generate version ${{ steps.bump_version.outputs.version }} of this library."
45-
4641
- name: Push to master
4742
run: git push origin master
4843
env:
4944
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
45+
- name: Slack notification
46+
uses: ravsamhq/notify-slack-action@v2
47+
if: always()
48+
with:
49+
status: ${{ job.status }}
50+
token: ${{ secrets.GITHUB_TOKEN }}
51+
notification_title: "{repo}: {workflow} workflow"
52+
message_format: "{emoji} *{workflow}* {status_message} in <{repo_url}|{repo}>"
53+
footer: "<{workflow_url}|View Workflow>"
54+
notify_when: "failure"
55+
env:
56+
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
5057
Publish:
5158
runs-on: ubuntu-latest
5259
steps:
@@ -63,6 +70,18 @@ jobs:
6370
with:
6471
user: __token__
6572
password: ${{ secrets.PYPI_API_TOKEN }}
73+
- name: Slack notification
74+
uses: ravsamhq/notify-slack-action@v2
75+
if: always()
76+
with:
77+
status: ${{ job.status }}
78+
token: ${{ secrets.GITHUB_TOKEN }}
79+
notification_title: "{repo}: {workflow} workflow"
80+
message_format: "{emoji} *{workflow}* {status_message} in <{repo_url}|{repo}>"
81+
footer: "<{workflow_url}|View Workflow>"
82+
notify_when: "failure"
83+
env:
84+
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
6685
Release:
6786
runs-on: ubuntu-latest
6887
steps:
@@ -80,3 +99,15 @@ jobs:
8099
gh release create "v${{ steps.read_version.outputs.version }}"
81100
env:
82101
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
102+
- name: Slack notification
103+
uses: ravsamhq/notify-slack-action@v2
104+
if: always()
105+
with:
106+
status: ${{ job.status }}
107+
token: ${{ secrets.GITHUB_TOKEN }}
108+
notification_title: "{repo}: {workflow} workflow"
109+
message_format: "{emoji} *{workflow}* {status_message} in <{repo_url}|{repo}>"
110+
footer: "<{workflow_url}|View Workflow>"
111+
notify_when: "failure"
112+
env:
113+
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}

.github/workflows/issues.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: Issues
2+
3+
on:
4+
issues:
5+
types: [opened, closed, reopened]
6+
7+
jobs:
8+
Notify:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v3
12+
- name: Slack notification
13+
uses: slackapi/slack-github-action@v1.23.0
14+
with:
15+
payload: |
16+
{
17+
"text": "*Issue ${{ github.event.issue.state }}*\n\n*Title:* ${{ github.event.issue.title }}\n*Repo:* ${{ github.repository }}\n*<${{ github.event.issue.html_url }}|Issue Link>*"
18+
}
19+
env:
20+
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}

.github/workflows/publish.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,15 @@ jobs:
2121
with:
2222
user: __token__
2323
password: ${{ secrets.PYPI_API_TOKEN }}
24+
- name: Slack notification
25+
uses: ravsamhq/notify-slack-action@v2
26+
if: always()
27+
with:
28+
status: ${{ job.status }}
29+
token: ${{ secrets.GITHUB_TOKEN }}
30+
notification_title: "{repo}: {workflow} workflow"
31+
message_format: "{emoji} *{workflow}* {status_message} in <{repo_url}|{repo}>"
32+
footer: "<{workflow_url}|View Workflow>"
33+
notify_when: "failure"
34+
env:
35+
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}

.github/workflows/release.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,15 @@ jobs:
2222
gh release create "v${{ steps.read_version.outputs.version }}"
2323
env:
2424
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
25+
- name: Slack notification
26+
uses: ravsamhq/notify-slack-action@v2
27+
if: always()
28+
with:
29+
status: ${{ job.status }}
30+
token: ${{ secrets.GITHUB_TOKEN }}
31+
notification_title: "{repo}: {workflow} workflow"
32+
message_format: "{emoji} *{workflow}* {status_message} in <{repo_url}|{repo}>"
33+
footer: "<{workflow_url}|View Workflow>"
34+
notify_when: "failure"
35+
env:
36+
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}

0 commit comments

Comments
 (0)