Skip to content

Commit 868e03e

Browse files
committed
refactor
1 parent 3eb37fb commit 868e03e

File tree

6 files changed

+114
-17
lines changed

6 files changed

+114
-17
lines changed

.github/workflows/container-promote.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,3 +56,26 @@ jobs:
5656
env:
5757
FILTER: ${{ github.event.inputs.filter }}
5858
CHECK_MODE: ${{ inputs.check_mode }}
59+
60+
- name: Send message to Slack via Workflow Builder
61+
uses: slackapi/[email protected]
62+
with:
63+
payload: |
64+
{
65+
"channel-id": "${{ env.SLACK_CHANNEL_ID }}",
66+
"inputs": "${{ env.INPUTS }}",
67+
"message": "${{ env.MESSAGE }}",
68+
"results-url": "${{ env.RESULTS_URL }}",
69+
"workflow-url": "${{ env.WORKFLOW_URL }}"
70+
}
71+
env:
72+
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
73+
SLACK_CHANNEL_ID: ${{ vars.SLACK_CHANNEL_ID }}
74+
INPUTS: >-
75+
filter: ${{ inputs.filter }}\n
76+
kayobe_config_branch: ${{ inputs.kayobe_config_branch }}\n
77+
check_mode: ${{ inputs.check_mode }}\n
78+
MESSAGE: "${{ github.workflow }} GitHub Actions workflow failed :sob:"
79+
RESULTS_URL: "N/A"
80+
WORKFLOW_URL: "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
81+
if: failure()

.github/workflows/container-publish.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,3 +46,25 @@ jobs:
4646
env:
4747
FILTER: ${{ github.event.inputs.filter }}
4848
DISTROS: ${{ github.event.inputs.distros }}
49+
50+
- name: Send message to Slack via Workflow Builder
51+
uses: slackapi/[email protected]
52+
with:
53+
payload: |
54+
{
55+
"channel-id": "${{ env.SLACK_CHANNEL_ID }}",
56+
"inputs": "${{ env.INPUTS }}",
57+
"message": "${{ env.MESSAGE }}",
58+
"results-url": "${{ env.RESULTS_URL }}",
59+
"workflow-url": "${{ env.WORKFLOW_URL }}"
60+
}
61+
env:
62+
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
63+
SLACK_CHANNEL_ID: ${{ vars.SLACK_CHANNEL_ID }}
64+
INPUTS: >-
65+
filter: ${{ inputs.filter }}\n
66+
distros: ${{ inputs.distros }}\n
67+
MESSAGE: "${{ github.workflow }} GitHub Actions workflow failed :sob:"
68+
RESULTS_URL: "N/A"
69+
WORKFLOW_URL: "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
70+
if: failure() && github.event_name == 'push'

.github/workflows/container-sync.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,3 +87,28 @@ jobs:
8787
DISTROS: ${{ github.event.inputs.distros }}
8888
SYNC_OLD_IMAGES: ${{ github.event.inputs.sync-old-images }}
8989
SYNC_NEW_IMAGES: ${{ github.event.inputs.sync-new-images }}
90+
91+
- name: Send message to Slack via Workflow Builder
92+
uses: slackapi/[email protected]
93+
with:
94+
payload: |
95+
{
96+
"channel-id": "${{ env.SLACK_CHANNEL_ID }}",
97+
"inputs": "${{ env.INPUTS }}",
98+
"message": "${{ env.MESSAGE }}",
99+
"results-url": "${{ env.RESULTS_URL }}",
100+
"workflow-url": "${{ env.WORKFLOW_URL }}"
101+
}
102+
env:
103+
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
104+
SLACK_CHANNEL_ID: ${{ vars.SLACK_CHANNEL_ID }}
105+
INPUTS: >-
106+
filter: ${{ inputs.filter }}\n
107+
distros: ${{ inputs.distros }}\n
108+
sync-old-images: ${{ inputs.sync-old-images }}\n
109+
sync-new-images: ${{ inputs.sync-new-images }}\n
110+
sync-test-pulp: ${{ inputs.sync-test-pulp }}\n
111+
MESSAGE: "${{ github.workflow }} GitHub Actions workflow failed :sob:"
112+
RESULTS_URL: "N/A"
113+
WORKFLOW_URL: "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
114+
if: failure()

.github/workflows/docs-publish.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,23 @@ jobs:
1515
python-version: 3.x
1616
- run: pip install -r docs-requirements.txt
1717
- run: mkdocs gh-deploy --force
18+
19+
- name: Send message to Slack via Workflow Builder
20+
uses: slackapi/[email protected]
21+
with:
22+
payload: |
23+
{
24+
"channel-id": "${{ env.SLACK_CHANNEL_ID }}",
25+
"inputs": "${{ env.INPUTS }}",
26+
"message": "${{ env.MESSAGE }}",
27+
"results-url": "${{ env.RESULTS_URL }}",
28+
"workflow-url": "${{ env.WORKFLOW_URL }}"
29+
}
30+
env:
31+
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
32+
SLACK_CHANNEL_ID: ${{ vars.SLACK_CHANNEL_ID }}
33+
INPUTS: "N/A"
34+
MESSAGE: "${{ github.workflow }} GitHub Actions workflow failed :sob:"
35+
RESULTS_URL: "N/A"
36+
WORKFLOW_URL: "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
37+
if: failure()

.github/workflows/package-promote.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,3 +58,26 @@ jobs:
5858
env:
5959
FILTER: ${{ github.event.inputs.filter }}
6060
CHECK_MODE: ${{ inputs.check_mode }}
61+
62+
- name: Send message to Slack via Workflow Builder
63+
uses: slackapi/[email protected]
64+
with:
65+
payload: |
66+
{
67+
"channel-id": "${{ env.SLACK_CHANNEL_ID }}",
68+
"inputs": "${{ env.INPUTS }}",
69+
"message": "${{ env.MESSAGE }}",
70+
"results-url": "${{ env.RESULTS_URL }}",
71+
"workflow-url": "${{ env.WORKFLOW_URL }}"
72+
}
73+
env:
74+
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
75+
SLACK_CHANNEL_ID: ${{ vars.SLACK_CHANNEL_ID }}
76+
INPUTS: >-
77+
filter: ${{ inputs.filter }}\n
78+
kayobe_config_branch: ${{ inputs.kayobe_config_branch }}\n
79+
check_mode: ${{ inputs.check_mode }}\n
80+
MESSAGE: "${{ github.workflow }} GitHub Actions workflow failed :sob:"
81+
RESULTS_URL: "N/A"
82+
WORKFLOW_URL: "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
83+
if: failure()

.github/workflows/terraform-github.yml

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -117,21 +117,5 @@ jobs:
117117
run: terraform apply -auto-approve -input=false
118118

119119
- name: Send message to Slack via Workflow Builder
120-
uses: slackapi/[email protected]
121-
with:
122-
payload: |
123-
{
124-
"channel-id": "${{ env.SLACK_CHANNEL_ID }}",
125-
"inputs": "${{ env.INPUTS }}",
126-
"message": "${{ env.MESSAGE }}",
127-
"results-url": "${{ env.RESULTS_URL }}",
128-
"workflow-url": "${{ env.WORKFLOW_URL }}"
129-
}
130-
env:
131-
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
132-
SLACK_CHANNEL_ID: ${{ vars.SLACK_CHANNEL_ID }}
133-
INPUTS: "N/A"
134-
MESSAGE: "${{ github.workflow }}/${{ github.job }} GitHub Actions workflow failed :sob:"
135-
RESULTS_URL: "N/A"
136-
WORKFLOW_URL: "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
120+
uses: .github/actions/slack-alert
137121
if: failure()

0 commit comments

Comments
 (0)