-
Notifications
You must be signed in to change notification settings - Fork 69
73 lines (72 loc) · 2.62 KB
/
notifier.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
72
73
name: Release Notifier
on:
workflow_run:
workflows:
- Vagrant HashiCorp Release
types:
- completed
jobs:
released:
if: github.event.workflow_run.conclusion == 'success'
runs-on: ['self-hosted', 'ondemand', 'linux', 'type=t3.small']
permissions:
id-token: write
contents: read
steps:
- name: Authentication
id: vault-auth
run: vault-auth
- name: Secrets
id: secrets
uses: hashicorp/vault-action@v2
with:
url: ${{ steps.vault-auth.outputs.addr }}
caCertificate: ${{ steps.vault-auth.outputs.ca_certificate }}
token: ${{ steps.vault-auth.outputs.token }}
secrets:
kv/data/teams/vagrant/slack webhook;
- name: Code Checkout
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- name: Send Notification
run: |
. .ci/load-ci.sh || exit
slack -m "$(printf "<%s|Vagrant release process> has completed successfully 🎉\n\nUpdate <https://checkpoint.hashicorp.com/control|checkpoint> to finalize release." "${WORKFLOW_URL")"
env:
SLACK_WEBHOOK: ${{ steps.secrets.outputs.webhook }}
SLACK_CHANNEL: '#team-vagrant'
SLACK_USERNAME: Release Notification
SLACK_TITLE: Vagrant Release Process
SLACK_STATE: success
WORKFLOW_URL: ${{ github.event.workflow_run.html_url }}
failed:
if: github.event.workflow_run.conclusion == 'failure'
runs-on: ['self-hosted', 'ondemand', 'linux', 'type=t3.small']
permissions:
id-token: write
contents: read
steps:
- name: Authentication
id: vault-auth
run: vault-auth
- name: Secrets
id: secrets
uses: hashicorp/vault-action@v2
with:
url: ${{ steps.vault-auth.outputs.addr }}
caCertificate: ${{ steps.vault-auth.outputs.ca_certificate }}
token: ${{ steps.vault-auth.outputs.token }}
secrets:
kv/data/teams/vagrant/slack webhook;
- name: Code Checkout
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- name: Send Notification
run: |
. .ci/load-ci.sh || exit
slack -m "$(printf "<%s|Vagrant release process> has failed" "${WORKFLOW_URL}")"
env:
SLACK_WEBHOOK: ${{ steps.secrets.outputs.webhook }}
SLACK_CHANNEL: '#team-vagrant'
SLACK_TITLE: '⚠️ Vagrant Release Process⚠️'
SLACK_USERNAME: Vagrant Release Builder
SLACK_STATE: error
WORKFLOW_URL: ${{ github.event.workflow_run.html_url }}