Skip to content

Commit 6589579

Browse files
author
Peter Bengtsson
authored
Fix Slack alert logic (#45044)
1 parent 1563325 commit 6589579

File tree

77 files changed

+72
-253
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

77 files changed

+72
-253
lines changed

.github/actions/slack-alert/action.yml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,6 @@ runs:
1414
steps:
1515
- name: Send Slack notification if workflow fails
1616
uses: someimportantcompany/github-actions-slack-message@1d367080235edfa53df415bd8e0bbab480f29bad
17-
if: >-
18-
${{
19-
failure() &&
20-
github.repository == 'github/docs-internal' &&
21-
github.event_name != 'pull_request' &&
22-
github.event_name != 'pull_request_target'
23-
}}
2417
with:
2518
channel: ${{ inputs.slack_channel_id }}
2619
bot-token: ${{ inputs.slack_token }}

.github/workflows/add-review-template.yml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,3 @@ jobs:
3737
GITHUB_TOKEN: ${{ secrets.DOCS_BOT_PAT_WORKFLOW_READORG }}
3838
PR: ${{ github.event.pull_request.html_url }}
3939
TEMPLATE: ${{ env.TEMPLATE }}
40-
41-
- uses: ./.github/actions/slack-alert
42-
with:
43-
slack_channel_id: ${{ secrets.DOCS_ALERTS_SLACK_CHANNEL_ID }}
44-
slack_token: ${{ secrets.SLACK_DOCS_BOT_TOKEN }}

.github/workflows/auto-close-dependencies.yml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,3 @@ jobs:
6666
console.error(`Failed to lock the pull request. Error: ${error}`)
6767
throw error
6868
}
69-
- name: Check out repo
70-
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0
71-
- uses: ./.github/actions/slack-alert
72-
with:
73-
slack_channel_id: ${{ secrets.DOCS_ALERTS_SLACK_CHANNEL_ID }}
74-
slack_token: ${{ secrets.SLACK_DOCS_BOT_TOKEN }}

.github/workflows/azure-preview-env-deploy.yml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -254,8 +254,3 @@ jobs:
254254
# The `--fail --retry N` combination means that a 4xx response
255255
# code will exit immediately but a 5xx will exhaust the retries.
256256
run: curl --fail --retry-connrefused --retry 5 -I ${{ env.APP_URL }}
257-
258-
- uses: ./.github/actions/slack-alert
259-
with:
260-
slack_channel_id: ${{ secrets.DOCS_ALERTS_SLACK_CHANNEL_ID }}
261-
slack_token: ${{ secrets.SLACK_DOCS_BOT_TOKEN }}

.github/workflows/azure-preview-env-destroy.yml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,3 @@ jobs:
7070
# The token provided by the workflow does not have the permissions to delete created environments
7171
token: ${{ secrets.DOCS_BOT_PAT_READPUBLICKEY }}
7272
environment: preview-env-${{ env.PR_NUMBER }}
73-
74-
- uses: ./.github/actions/slack-alert
75-
with:
76-
slack_channel_id: ${{ secrets.DOCS_ALERTS_SLACK_CHANNEL_ID }}
77-
slack_token: ${{ secrets.SLACK_DOCS_BOT_TOKEN }}

.github/workflows/azure-prod-build-deploy.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,7 @@ jobs:
147147
az webapp deployment slot swap --slot canary --target-slot production -n ghdocs-prod -g docs-prod
148148
149149
- uses: ./.github/actions/slack-alert
150+
if: ${{ failure() && github.event_name != 'workflow_dispatch' }}
150151
with:
151152
slack_channel_id: ${{ secrets.DOCS_ALERTS_SLACK_CHANNEL_ID }}
152153
slack_token: ${{ secrets.SLACK_DOCS_BOT_TOKEN }}

.github/workflows/azure-staging-build-deploy.yml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -157,8 +157,3 @@ jobs:
157157
- name: 'Swap deployment slot to production'
158158
run: |
159159
az webapp deployment slot swap --slot ${{ env.SLOT_NAME }} --target-slot production -n ${{ env.APP_SERVICE_NAME }} -g ${{ env.RESOURCE_GROUP_NAME }}
160-
161-
- uses: ./.github/actions/slack-alert
162-
with:
163-
slack_channel_id: ${{ secrets.DOCS_ALERTS_SLACK_CHANNEL_ID }}
164-
slack_token: ${{ secrets.SLACK_DOCS_BOT_TOKEN }}

.github/workflows/check-broken-links-github-github.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ jobs:
8888
labels: ${{ env.REPORT_LABEL }}
8989

9090
- uses: ./.github/actions/slack-alert
91+
if: ${{ failure() && github.event_name != 'workflow_dispatch' }}
9192
with:
9293
slack_channel_id: ${{ secrets.DOCS_ALERTS_SLACK_CHANNEL_ID }}
9394
slack_token: ${{ secrets.SLACK_DOCS_BOT_TOKEN }}

.github/workflows/check-for-spammy-issues.yml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -80,10 +80,3 @@ jobs:
8080
} catch (error) {
8181
console.log(error);
8282
}
83-
84-
- name: Check out repo
85-
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0
86-
- uses: ./.github/actions/slack-alert
87-
with:
88-
slack_channel_id: ${{ secrets.DOCS_ALERTS_SLACK_CHANNEL_ID }}
89-
slack_token: ${{ secrets.SLACK_DOCS_BOT_TOKEN }}

.github/workflows/close-bad-repo-sync-prs.yml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,3 @@ jobs:
6060
issue_number: prNumber,
6161
body: "Please leave this `repo-sync` branch to the robots!\n\nI'm going to close this pull request now, but feel free to open a new issue or ask any questions in [discussions](https://github.com/github/docs/discussions)!"
6262
})
63-
64-
- name: Check out repo
65-
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0
66-
- uses: ./.github/actions/slack-alert
67-
with:
68-
slack_channel_id: ${{ secrets.DOCS_ALERTS_SLACK_CHANNEL_ID }}
69-
slack_token: ${{ secrets.SLACK_DOCS_BOT_TOKEN }}

0 commit comments

Comments
 (0)