Skip to content

Commit 5d5f752

Browse files
authored
Merge pull request #17 from notificationapi-com/s1N2rr1F/2737-new-channels-for-failure-and-success-github-actions
S1 n2rr1 f/2737 new channels for failure and success GitHub actions
2 parents 21bdc2d + 135ebf5 commit 5d5f752

File tree

2 files changed

+31
-16
lines changed

2 files changed

+31
-16
lines changed

.github/workflows/ci.yml

Lines changed: 27 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,16 @@ on:
1111

1212
jobs:
1313
ci:
14-
runs-on: ubuntu-latest
14+
# Using 22.04 to be compatiable with Python 3.7 until it is deprecated
15+
runs-on: ubuntu-22.04
1516
strategy:
1617
matrix:
1718
python-version: [ 3.7, 3.8, 3.9]
1819

1920
steps:
20-
- uses: actions/checkout@v2
21+
- uses: actions/checkout@v4
2122
- name: Set up Python ${{ matrix.python-version }}
22-
uses: actions/setup-python@v2
23+
uses: actions/setup-python@v4
2324
with:
2425
python-version: ${{ matrix.python-version }}
2526

@@ -53,9 +54,9 @@ jobs:
5354
needs: ci
5455
runs-on: ubuntu-latest
5556
steps:
56-
- uses: actions/checkout@v2
57+
- uses: actions/checkout@v4
5758
- name: Set up Python 3.9
58-
uses: actions/setup-python@v2
59+
uses: actions/setup-python@v4
5960
with:
6061
python-version: 3.9
6162

@@ -71,14 +72,27 @@ jobs:
7172
TWINE_USERNAME: "__token__"
7273
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
7374

74-
- name: Send Slack notification
75+
- name: Send Slack notification for success
76+
if: success()
7577
uses: 8398a7/action-slack@v3
7678
with:
77-
author_name: Python Server SDK
78-
status: ${{ job.status }}
79-
fields: repo,job
80-
text: "PyPi Package: https://pypi.org/project/notificationapi-python-server-sdk"
79+
author_name: Python Server SDK
80+
status: ${{ job.status }}
81+
fields: repo,message,commit,action,workflow,took
82+
text: "PyPi Package: https://pypi.org/project/notificationapi-python-server-sdk"
8183
env:
82-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
83-
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
84-
if: always()
84+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
85+
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_SUCCESS_WEBHOOK_URL }}
86+
87+
- name: Send Slack notification for failure or cancellation
88+
if: failure() || cancelled()
89+
uses: 8398a7/action-slack@v3
90+
with:
91+
author_name: Python Server SDK
92+
status: ${{ job.status }}
93+
fields: repo,message,commit,action,workflow,took
94+
text: "PyPi Package: https://pypi.org/project/notificationapi-python-server-sdk"
95+
env:
96+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
97+
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_FAILED_WEBHOOK_URL }}
98+

.github/workflows/pullRequest.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,16 @@ on:
1111

1212
jobs:
1313
ci:
14-
runs-on: ubuntu-latest
14+
# Using 22.04 to be compatiable with Python 3.7 until it is deprecated
15+
runs-on: ubuntu-22.04
1516
strategy:
1617
matrix:
1718
python-version: [ 3.7, 3.8, 3.9]
1819

1920
steps:
20-
- uses: actions/checkout@v2
21+
- uses: actions/checkout@v4
2122
- name: Set up Python ${{ matrix.python-version }}
22-
uses: actions/setup-python@v2
23+
uses: actions/setup-python@v4
2324
with:
2425
python-version: ${{ matrix.python-version }}
2526

0 commit comments

Comments
 (0)