-
Notifications
You must be signed in to change notification settings - Fork 22
45 lines (39 loc) · 1.27 KB
/
update_git_hub_labels.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
name: Update GitHub Labels
on:
# Triggers the workflow weekly on Monday at 7AM PT
schedule:
- cron: '0 14 * * 1'
workflow_dispatch:
jobs:
labels:
runs-on: ubuntu-latest
steps:
- name: Checkout dx-automator
uses: actions/checkout@v3
- name: Setup Python
uses: actions/setup-python@v4
with:
cache: 'pip'
- name: Install Dependencies
run: pip install -r requirements.txt
- name: Update Labels
run: python examples/update_git_hub_labels.py
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
notify-on-failure:
name: Slack notify on failure
if: failure()
needs: [ labels ]
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: Update GitHub Labels 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