-
Notifications
You must be signed in to change notification settings - Fork 22
71 lines (62 loc) · 2.48 KB
/
action_items.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
# This is a basic workflow to help you get started with Actions
name: action_items
# Controls when the action will run.
on:
# Triggers the workflow on push or pull request events but only for the main branch
schedule:
- cron: '0 15 * * 1-5'
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "actionItems"
actionItems:
# The type of runner that the job will run on
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v3
- name: Setup Python
uses: actions/setup-python@v4
- name: Install Dependencies
run: make install
- name: Get Action Items
id: get_action_items
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
output=$(source venv/bin/activate && python examples/action_items.py)
output="${output//'%'/'%25'}"
output="${output//$'\n'/'%0A'}"
output="${output//$'\r'/'%0D'}"
echo "::set-output name=items::$output"
- name: Slack Notify
uses: rtCamp/[email protected]
env:
SLACK_COLOR: '#3278BD'
SLACK_ICON_EMOJI: ':blobcatbusiness:'
SLACK_MESSAGE: '```${{ steps.get_action_items.outputs.items }}```'
SLACK_TITLE: Action Items
SLACK_USERNAME: DX Automator
SLACK_MSG_AUTHOR: twilio-dx
SLACK_FOOTER: Posted automatically using GitHub Actions
MSG_MINIMAL: true
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
notify-on-failure:
name: Slack notify on failure
if: ${{ failure() }}
needs: [actionItems]
runs-on: ubuntu-latest
steps:
- uses: rtCamp/action-slack-notify@v2
env:
SLACK_COLOR: 'danger'
SLACK_ICON_EMOJI: ':github:'
SLACK_MESSAGE: ${{ format('Build {2} in {1} failed{3} {0}/{1}/actions/runs/{2}', github.server_url, github.repository, github.run_id, ':') }}
SLACK_TITLE: Action Items Failure
SLACK_USERNAME: GitHub Actions
SLACK_MSG_AUTHOR: twilio-dx
SLACK_FOOTER: Posted automatically using GitHub Actions
SLACK_WEBHOOK: ${{ secrets.ALERTS_SLACK_WEBHOOK }}
MSG_MINIMAL: true