1
0
mirror of synced 2025-12-19 18:10:59 -05:00

Standardized slack alert fails (#44074)

This commit is contained in:
Kevin Heis
2023-10-13 11:06:12 -07:00
committed by GitHub
parent 4465644076
commit 4a534c5d82
78 changed files with 473 additions and 166 deletions

29
.github/actions/slack-alert/action.yml vendored Normal file
View File

@@ -0,0 +1,29 @@
name: Send Slack notification if workflow fails
description: Send Slack notification if workflow fails
inputs:
slack_channel_id:
description: Slack channel ID
required: true
slack_token:
description: Slack token
required: true
runs:
using: composite
steps:
- name: Send Slack notification if workflow fails
uses: someimportantcompany/github-actions-slack-message@1d367080235edfa53df415bd8e0bbab480f29bad
if: >-
${{
failure() &&
env.FREEZE != 'true' &&
github.repository == 'github/docs-internal' &&
github.event_name != 'pull_request' &&
github.event_name != 'pull_request_target'
}}
with:
channel: ${{ inputs.slack_channel_id }}
bot-token: ${{ inputs.slack_token }}
color: failure
text: The last '${{ github.workflow }}' run failed. See ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}

View File

@@ -37,3 +37,8 @@ jobs:
GITHUB_TOKEN: ${{ secrets.DOCS_BOT_PAT_WORKFLOW_READORG }} GITHUB_TOKEN: ${{ secrets.DOCS_BOT_PAT_WORKFLOW_READORG }}
PR: ${{ github.event.pull_request.html_url }} PR: ${{ github.event.pull_request.html_url }}
TEMPLATE: ${{ env.TEMPLATE }} TEMPLATE: ${{ env.TEMPLATE }}
- uses: ./.github/actions/slack-alert
with:
slack_channel_id: ${{ secrets.DOCS_ALERTS_SLACK_CHANNEL_ID }}
slack_token: ${{ secrets.SLACK_DOCS_BOT_TOKEN }}

View File

@@ -66,3 +66,8 @@ jobs:
console.error(`Failed to lock the pull request. Error: ${error}`) console.error(`Failed to lock the pull request. Error: ${error}`)
throw error throw error
} }
- uses: ./.github/actions/slack-alert
with:
slack_channel_id: ${{ secrets.DOCS_ALERTS_SLACK_CHANNEL_ID }}
slack_token: ${{ secrets.SLACK_DOCS_BOT_TOKEN }}

View File

@@ -254,3 +254,8 @@ jobs:
# The `--fail --retry N` combination means that a 4xx response # The `--fail --retry N` combination means that a 4xx response
# code will exit immediately but a 5xx will exhaust the retries. # code will exit immediately but a 5xx will exhaust the retries.
run: curl --fail --retry-connrefused --retry 5 -I ${{ env.APP_URL }} run: curl --fail --retry-connrefused --retry 5 -I ${{ env.APP_URL }}
- uses: ./.github/actions/slack-alert
with:
slack_channel_id: ${{ secrets.DOCS_ALERTS_SLACK_CHANNEL_ID }}
slack_token: ${{ secrets.SLACK_DOCS_BOT_TOKEN }}

View File

@@ -25,7 +25,7 @@ concurrency:
cancel-in-progress: true cancel-in-progress: true
jobs: jobs:
destory-azure-preview-env: destroy-azure-preview-env:
name: Destroy name: Destroy
runs-on: ubuntu-latest runs-on: ubuntu-latest
if: github.repository == 'github/docs-internal' || github.repository == 'github/docs' if: github.repository == 'github/docs-internal' || github.repository == 'github/docs'
@@ -70,3 +70,8 @@ jobs:
# The token provided by the workflow does not have the permissions to delete created environments # The token provided by the workflow does not have the permissions to delete created environments
token: ${{ secrets.DOCS_BOT_PAT_READPUBLICKEY }} token: ${{ secrets.DOCS_BOT_PAT_READPUBLICKEY }}
environment: preview-env-${{ env.PR_NUMBER }} environment: preview-env-${{ env.PR_NUMBER }}
- uses: ./.github/actions/slack-alert
with:
slack_channel_id: ${{ secrets.DOCS_ALERTS_SLACK_CHANNEL_ID }}
slack_token: ${{ secrets.SLACK_DOCS_BOT_TOKEN }}

View File

@@ -146,11 +146,7 @@ jobs:
run: | run: |
az webapp deployment slot swap --slot canary --target-slot production -n ghdocs-prod -g docs-prod az webapp deployment slot swap --slot canary --target-slot production -n ghdocs-prod -g docs-prod
- name: Send Slack notification if workflow failed - uses: ./.github/actions/slack-alert
uses: someimportantcompany/github-actions-slack-message@1d367080235edfa53df415bd8e0bbab480f29bad
if: ${{ failure() }}
with: with:
channel: ${{ secrets.DOCS_ALERTS_SLACK_CHANNEL_ID }} slack_channel_id: ${{ secrets.DOCS_ALERTS_SLACK_CHANNEL_ID }}
bot-token: ${{ secrets.SLACK_DOCS_BOT_TOKEN }} slack_token: ${{ secrets.SLACK_DOCS_BOT_TOKEN }}
color: failure
text: Production deployment (Azure) failed at commit ${{ github.sha }}. See https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}

View File

@@ -157,3 +157,8 @@ jobs:
- name: 'Swap deployment slot to production' - name: 'Swap deployment slot to production'
run: | run: |
az webapp deployment slot swap --slot ${{ env.SLOT_NAME }} --target-slot production -n ${{ env.APP_SERVICE_NAME }} -g ${{ env.RESOURCE_GROUP_NAME }} az webapp deployment slot swap --slot ${{ env.SLOT_NAME }} --target-slot production -n ${{ env.APP_SERVICE_NAME }} -g ${{ env.RESOURCE_GROUP_NAME }}
- uses: ./.github/actions/slack-alert
with:
slack_channel_id: ${{ secrets.DOCS_ALERTS_SLACK_CHANNEL_ID }}
slack_token: ${{ secrets.SLACK_DOCS_BOT_TOKEN }}

View File

@@ -87,11 +87,7 @@ jobs:
repository: ${{ env.REPORT_REPOSITORY }} repository: ${{ env.REPORT_REPOSITORY }}
labels: ${{ env.REPORT_LABEL }} labels: ${{ env.REPORT_LABEL }}
- name: Send Slack notification if workflow fails - uses: ./.github/actions/slack-alert
uses: someimportantcompany/github-actions-slack-message@1d367080235edfa53df415bd8e0bbab480f29bad
if: ${{ failure() && env.FREEZE != 'true' }}
with: with:
channel: ${{ secrets.DOCS_ALERTS_SLACK_CHANNEL_ID }} slack_channel_id: ${{ secrets.DOCS_ALERTS_SLACK_CHANNEL_ID }}
bot-token: ${{ secrets.SLACK_DOCS_BOT_TOKEN }} slack_token: ${{ secrets.SLACK_DOCS_BOT_TOKEN }}
color: failure
text: The last "Check Broken Docs Links in github/github" run for ${{github.repository}} failed. See https://github.com/${{github.repository}}/actions/workflows/check-broken-links-github-github.yml

View File

@@ -80,3 +80,8 @@ jobs:
} catch (error) { } catch (error) {
console.log(error); console.log(error);
} }
- uses: ./.github/actions/slack-alert
with:
slack_channel_id: ${{ secrets.DOCS_ALERTS_SLACK_CHANNEL_ID }}
slack_token: ${{ secrets.SLACK_DOCS_BOT_TOKEN }}

View File

@@ -61,11 +61,7 @@ jobs:
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)!" 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)!"
}) })
- name: Send Slack notification if workflow fails - uses: ./.github/actions/slack-alert
uses: someimportantcompany/github-actions-slack-message@1d367080235edfa53df415bd8e0bbab480f29bad
if: failure()
with: with:
channel: ${{ secrets.DOCS_ALERTS_SLACK_CHANNEL_ID }} slack_channel_id: ${{ secrets.DOCS_ALERTS_SLACK_CHANNEL_ID }}
bot-token: ${{ secrets.SLACK_DOCS_BOT_TOKEN }} slack_token: ${{ secrets.SLACK_DOCS_BOT_TOKEN }}
color: failure
text: The last close-bad-repo-sync-prs run for ${{github.repository}} failed. See https://github.com/${{github.repository}}/actions?query=Close+bad+repo-sync+PRs

View File

@@ -31,3 +31,8 @@ jobs:
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: gh pr close ${{ github.event.pull_request.html_url }} run: gh pr close ${{ github.event.pull_request.html_url }}
- uses: ./.github/actions/slack-alert
with:
slack_channel_id: ${{ secrets.DOCS_ALERTS_SLACK_CHANNEL_ID }}
slack_token: ${{ secrets.SLACK_DOCS_BOT_TOKEN }}

View File

@@ -20,3 +20,8 @@ jobs:
GH_TOKEN: ${{ secrets.DOCS_BOT_PAT_WRITEORG_PROJECT }} GH_TOKEN: ${{ secrets.DOCS_BOT_PAT_WRITEORG_PROJECT }}
PR: ${{ github.event.pull_request.html_url }} PR: ${{ github.event.pull_request.html_url }}
run: gh pr edit $PR --add-reviewer github/docs-content-strategy run: gh pr edit $PR --add-reviewer github/docs-content-strategy
- uses: ./.github/actions/slack-alert
with:
slack_channel_id: ${{ secrets.DOCS_ALERTS_SLACK_CHANNEL_ID }}
slack_token: ${{ secrets.SLACK_DOCS_BOT_TOKEN }}

View File

@@ -57,6 +57,7 @@ jobs:
id=9664BE8F1CA3 id=9664BE8F1CA3
body=$(gh pr view $PR --json body | jq -r .body) body=$(gh pr view $PR --json body | jq -r .body)
append=$(cat <<-EOM append=$(cat <<-EOM
<!-- $id --> <!-- $id -->
### For engineers ### For engineers
@@ -75,3 +76,8 @@ jobs:
body+=$append body+=$append
gh pr edit $PR --body "$body" gh pr edit $PR --body "$body"
fi fi
- uses: ./.github/actions/slack-alert
with:
slack_channel_id: ${{ secrets.DOCS_ALERTS_SLACK_CHANNEL_ID }}
slack_token: ${{ secrets.SLACK_DOCS_BOT_TOKEN }}

View File

@@ -36,3 +36,8 @@ jobs:
languages: javascript # comma separated list of values from {go, python, javascript, java, cpp, csharp, ruby} languages: javascript # comma separated list of values from {go, python, javascript, java, cpp, csharp, ruby}
- uses: github/codeql-action/analyze@32dc499307d133bb5085bae78498c0ac2cf762d5 - uses: github/codeql-action/analyze@32dc499307d133bb5085bae78498c0ac2cf762d5
continue-on-error: true continue-on-error: true
- uses: ./.github/actions/slack-alert
with:
slack_channel_id: ${{ secrets.DOCS_ALERTS_SLACK_CHANNEL_ID }}
slack_token: ${{ secrets.SLACK_DOCS_BOT_TOKEN }}

View File

@@ -79,3 +79,8 @@ jobs:
channel: ${{ secrets.DOCS_OPEN_SOURCE_SLACK_CHANNEL_ID }} channel: ${{ secrets.DOCS_OPEN_SOURCE_SLACK_CHANNEL_ID }}
bot-token: ${{ secrets.SLACK_DOCS_BOT_TOKEN }} bot-token: ${{ secrets.SLACK_DOCS_BOT_TOKEN }}
text: <@${{github.actor}}> opened https://github.com/github/docs/issues/${{ github.event.number || github.event.issue.number }} publicly on the github/docs repo instead of a private repo. They have been notified via a new issue in the private repo to confirm this was intentional. text: <@${{github.actor}}> opened https://github.com/github/docs/issues/${{ github.event.number || github.event.issue.number }} publicly on the github/docs repo instead of a private repo. They have been notified via a new issue in the private repo to confirm this was intentional.
- uses: ./.github/actions/slack-alert
with:
slack_channel_id: ${{ secrets.DOCS_ALERTS_SLACK_CHANNEL_ID }}
slack_token: ${{ secrets.SLACK_DOCS_BOT_TOKEN }}

View File

@@ -41,6 +41,11 @@ jobs:
filterContentDir: filterContentDir:
- 'content/**/*' - 'content/**/*'
- uses: ./.github/actions/slack-alert
with:
slack_channel_id: ${{ secrets.DOCS_ALERTS_SLACK_CHANNEL_ID }}
slack_token: ${{ secrets.SLACK_DOCS_BOT_TOKEN }}
filterContentDir: filterContentDir:
needs: PR-Preview-Links needs: PR-Preview-Links
if: ${{ needs.PR-Preview-Links.outputs.filterContentDir == 'true' }} if: ${{ needs.PR-Preview-Links.outputs.filterContentDir == 'true' }}
@@ -107,3 +112,8 @@ jobs:
ghes: GitHub Enterprise Server ghes: GitHub Enterprise Server
ghae: GitHub AE ghae: GitHub AE
edit-mode: replace edit-mode: replace
- uses: ./.github/actions/slack-alert
with:
slack_channel_id: ${{ secrets.DOCS_ALERTS_SLACK_CHANNEL_ID }}
slack_token: ${{ secrets.SLACK_DOCS_BOT_TOKEN }}

View File

@@ -39,3 +39,8 @@ jobs:
- name: Run content linter if changed content/data files - name: Run content linter if changed content/data files
if: steps.changed-files.outputs.any_changed == 'true' if: steps.changed-files.outputs.any_changed == 'true'
run: npm run lint-content -- --errors-only --paths ${{ steps.changed-files.outputs.all_changed_files }} run: npm run lint-content -- --errors-only --paths ${{ steps.changed-files.outputs.all_changed_files }}
- uses: ./.github/actions/slack-alert
with:
slack_channel_id: ${{ secrets.DOCS_ALERTS_SLACK_CHANNEL_ID }}
slack_token: ${{ secrets.SLACK_DOCS_BOT_TOKEN }}

View File

@@ -70,3 +70,8 @@ jobs:
GITHUB_TOKEN: ${{secrets.DOCS_BOT_PAT_WORKFLOW_READORG}} GITHUB_TOKEN: ${{secrets.DOCS_BOT_PAT_WORKFLOW_READORG}}
NEW_ISSUE: ${{ env.NEW_ISSUE }} NEW_ISSUE: ${{ env.NEW_ISSUE }}
OLD_ISSUE: ${{ github.event.issue.html_url }} OLD_ISSUE: ${{ github.event.issue.html_url }}
- uses: ./.github/actions/slack-alert
with:
slack_channel_id: ${{ secrets.DOCS_ALERTS_SLACK_CHANNEL_ID }}
slack_token: ${{ secrets.SLACK_DOCS_BOT_TOKEN }}

View File

@@ -52,3 +52,8 @@ jobs:
REPO: 'audit-log-allowlists' REPO: 'audit-log-allowlists'
REVIEWER: 'docs-reviewers' REVIEWER: 'docs-reviewers'
FEATURE: 'Audit log event descriptions' FEATURE: 'Audit log event descriptions'
- uses: ./.github/actions/slack-alert
with:
slack_channel_id: ${{ secrets.DOCS_ALERTS_SLACK_CHANNEL_ID }}
slack_token: ${{ secrets.SLACK_DOCS_BOT_TOKEN }}

View File

@@ -63,3 +63,8 @@ jobs:
echo "More than 1 asset image was deleted as part of this PR." echo "More than 1 asset image was deleted as part of this PR."
echo "See posted PR commented about how to get them back." echo "See posted PR commented about how to get them back."
exit 1 exit 1
- uses: ./.github/actions/slack-alert
with:
slack_channel_id: ${{ secrets.DOCS_ALERTS_SLACK_CHANNEL_ID }}
slack_token: ${{ secrets.SLACK_DOCS_BOT_TOKEN }}

View File

@@ -87,11 +87,7 @@ jobs:
github-token: ${{ secrets.GITHUB_TOKEN }} github-token: ${{ secrets.GITHUB_TOKEN }}
number: ${{ steps.create-pull-request.outputs.pull-request-number }} number: ${{ steps.create-pull-request.outputs.pull-request-number }}
- name: Send Slack notification if workflow fails - uses: ./.github/actions/slack-alert
uses: someimportantcompany/github-actions-slack-message@1d367080235edfa53df415bd8e0bbab480f29bad
if: ${{ failure() && env.FREEZE != 'true' }}
with: with:
channel: ${{ secrets.DOCS_ALERTS_SLACK_CHANNEL_ID }} slack_channel_id: ${{ secrets.DOCS_ALERTS_SLACK_CHANNEL_ID }}
bot-token: ${{ secrets.SLACK_DOCS_BOT_TOKEN }} slack_token: ${{ secrets.SLACK_DOCS_BOT_TOKEN }}
color: failure
text: The last enterprise-dates run for ${{github.repository}} failed. See https://github.com/${{github.repository}}/actions/workflows/enterprise-dates.yml

View File

@@ -62,6 +62,10 @@ jobs:
project-url: 'https://github.com/orgs/github/projects/1367' project-url: 'https://github.com/orgs/github/projects/1367'
column-name: 'Docs-internal external contributor PRs' column-name: 'Docs-internal external contributor PRs'
- uses: ./.github/actions/slack-alert
with:
slack_channel_id: ${{ secrets.DOCS_ALERTS_SLACK_CHANNEL_ID }}
slack_token: ${{ secrets.SLACK_DOCS_BOT_TOKEN }}
first-responder-remove-pr: first-responder-remove-pr:
name: Remove PR from FR project board name: Remove PR from FR project board
if: github.repository == 'github/docs-internal' && ((github.event.label.name == 'docs-content-fr' && github.event.action == 'unlabeled') || github.event.action == 'closed') && github.actor != 'dependabot[bot]' if: github.repository == 'github/docs-internal' && ((github.event.label.name == 'docs-content-fr' && github.event.action == 'unlabeled') || github.event.action == 'closed') && github.actor != 'dependabot[bot]'
@@ -94,3 +98,8 @@ jobs:
with: with:
repo-token: '${{ secrets.DOCS_BOT_PAT_WORKFLOW_READORG }}' repo-token: '${{ secrets.DOCS_BOT_PAT_WORKFLOW_READORG }}'
remove-labels: 'docs-content-fr' remove-labels: 'docs-content-fr'
- uses: ./.github/actions/slack-alert
with:
slack_channel_id: ${{ secrets.DOCS_ALERTS_SLACK_CHANNEL_ID }}
slack_token: ${{ secrets.SLACK_DOCS_BOT_TOKEN }}

View File

@@ -58,3 +58,8 @@ jobs:
# so that we can run them without blocking merges until we can be confident # so that we can run them without blocking merges until we can be confident
# results for a11y tests are meaningul and scenarios we're testing are correct. # results for a11y tests are meaningul and scenarios we're testing are correct.
run: npm run playwright-test -- ${{ matrix.node }} --reporter list run: npm run playwright-test -- ${{ matrix.node }} --reporter list
- uses: ./.github/actions/slack-alert
with:
slack_channel_id: ${{ secrets.DOCS_ALERTS_SLACK_CHANNEL_ID }}
slack_token: ${{ secrets.SLACK_DOCS_BOT_TOKEN }}

View File

@@ -48,3 +48,8 @@ jobs:
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PR: ${{ github.event.pull_request.html_url }} PR: ${{ github.event.pull_request.html_url }}
- uses: ./.github/actions/slack-alert
with:
slack_channel_id: ${{ secrets.DOCS_ALERTS_SLACK_CHANNEL_ID }}
slack_token: ${{ secrets.SLACK_DOCS_BOT_TOKEN }}

View File

@@ -31,3 +31,8 @@ jobs:
run: npm run build run: npm run build
- uses: ./.github/actions/warmup-remotejson-cache - uses: ./.github/actions/warmup-remotejson-cache
- uses: ./.github/actions/slack-alert
with:
slack_channel_id: ${{ secrets.DOCS_ALERTS_SLACK_CHANNEL_ID }}
slack_token: ${{ secrets.SLACK_DOCS_BOT_TOKEN }}

View File

@@ -83,3 +83,8 @@ jobs:
with: with:
name: artifacts name: artifacts
path: ./artifacts path: ./artifacts
- uses: ./.github/actions/slack-alert
with:
slack_channel_id: ${{ secrets.DOCS_ALERTS_SLACK_CHANNEL_ID }}
slack_token: ${{ secrets.SLACK_DOCS_BOT_TOKEN }}

View File

@@ -61,3 +61,8 @@ jobs:
if: ${{ steps.changed_links.outputs.has_flaws_at_level == 'true' || steps.all_links.outputs.has_flaws_at_level == 'true' }} if: ${{ steps.changed_links.outputs.has_flaws_at_level == 'true' || steps.all_links.outputs.has_flaws_at_level == 'true' }}
run: | run: |
exit 1 exit 1
- uses: ./.github/actions/slack-alert
with:
slack_channel_id: ${{ secrets.DOCS_ALERTS_SLACK_CHANNEL_ID }}
slack_token: ${{ secrets.SLACK_DOCS_BOT_TOKEN }}

View File

@@ -47,3 +47,8 @@ jobs:
- name: Run TypeScript - name: Run TypeScript
run: npm run tsc run: npm run tsc
- uses: ./.github/actions/slack-alert
with:
slack_channel_id: ${{ secrets.DOCS_ALERTS_SLACK_CHANNEL_ID }}
slack_token: ${{ secrets.SLACK_DOCS_BOT_TOKEN }}

View File

@@ -42,3 +42,8 @@ jobs:
REPORT_LABEL: broken content markdown report REPORT_LABEL: broken content markdown report
REPORT_REPOSITORY: github/docs-content REPORT_REPOSITORY: github/docs-content
run: node src/content-linter/scripts/post-lints.js --path /tmp/error-lints.json run: node src/content-linter/scripts/post-lints.js --path /tmp/error-lints.json
- uses: ./.github/actions/slack-alert
with:
slack_channel_id: ${{ secrets.DOCS_ALERTS_SLACK_CHANNEL_ID }}
slack_token: ${{ secrets.SLACK_DOCS_BOT_TOKEN }}

View File

@@ -75,3 +75,8 @@ jobs:
else else
echo "As expected, it failed :)" echo "As expected, it failed :)"
fi fi
- uses: ./.github/actions/slack-alert
with:
slack_channel_id: ${{ secrets.DOCS_ALERTS_SLACK_CHANNEL_ID }}
slack_token: ${{ secrets.SLACK_DOCS_BOT_TOKEN }}

View File

@@ -76,3 +76,8 @@ jobs:
tags: ${{ env.DOCKER_IMAGE_CACHE_REF }} tags: ${{ env.DOCKER_IMAGE_CACHE_REF }}
cache-from: type=registry,ref=${{ env.DOCKER_IMAGE_CACHE_REF }} cache-from: type=registry,ref=${{ env.DOCKER_IMAGE_CACHE_REF }}
cache-to: type=registry,mode=max,ref=${{ env.DOCKER_IMAGE_CACHE_REF }} cache-to: type=registry,mode=max,ref=${{ env.DOCKER_IMAGE_CACHE_REF }}
- uses: ./.github/actions/slack-alert
with:
slack_channel_id: ${{ secrets.DOCS_ALERTS_SLACK_CHANNEL_ID }}
slack_token: ${{ secrets.SLACK_DOCS_BOT_TOKEN }}

View File

@@ -26,3 +26,8 @@ jobs:
FASTLY_SERVICE_ID: ${{ secrets.FASTLY_SERVICE_ID }} FASTLY_SERVICE_ID: ${{ secrets.FASTLY_SERVICE_ID }}
FASTLY_SURROGATE_KEY: 'manual-purge' FASTLY_SURROGATE_KEY: 'manual-purge'
run: src/workflows/purge-fastly-edge-cache.js run: src/workflows/purge-fastly-edge-cache.js
- uses: ./.github/actions/slack-alert
with:
slack_channel_id: ${{ secrets.DOCS_ALERTS_SLACK_CHANNEL_ID }}
slack_token: ${{ secrets.SLACK_DOCS_BOT_TOKEN }}

View File

@@ -26,3 +26,8 @@ jobs:
issue_number: context.payload.pull_request.number, issue_number: context.payload.pull_request.number,
body: "Thanks very much for contributing! Your pull request has been merged 🎉 You should see your changes appear on the site in approximately 24 hours. If you're looking for your next contribution, check out our [help wanted issues](https://github.com/github/docs/issues?q=is%3Aopen+is%3Aissue+label%3A%22help+wanted%22) :zap:" body: "Thanks very much for contributing! Your pull request has been merged 🎉 You should see your changes appear on the site in approximately 24 hours. If you're looking for your next contribution, check out our [help wanted issues](https://github.com/github/docs/issues?q=is%3Aopen+is%3Aissue+label%3A%22help+wanted%22) :zap:"
}) })
- uses: ./.github/actions/slack-alert
with:
slack_channel_id: ${{ secrets.DOCS_ALERTS_SLACK_CHANNEL_ID }}
slack_token: ${{ secrets.SLACK_DOCS_BOT_TOKEN }}

View File

@@ -77,3 +77,8 @@ jobs:
}) })
} }
} }
- uses: ./.github/actions/slack-alert
with:
slack_channel_id: ${{ secrets.DOCS_ALERTS_SLACK_CHANNEL_ID }}
slack_token: ${{ secrets.SLACK_DOCS_BOT_TOKEN }}

View File

@@ -26,3 +26,8 @@ jobs:
project: Docs open source board project: Docs open source board
column: Help wanted column: Help wanted
repo-token: ${{ secrets.DOCS_BOT_PAT_WORKFLOW_READORG }} repo-token: ${{ secrets.DOCS_BOT_PAT_WORKFLOW_READORG }}
- uses: ./.github/actions/slack-alert
with:
slack_channel_id: ${{ secrets.DOCS_ALERTS_SLACK_CHANNEL_ID }}
slack_token: ${{ secrets.SLACK_DOCS_BOT_TOKEN }}

View File

@@ -88,3 +88,8 @@ jobs:
issue_number: newIssueNumber, issue_number: newIssueNumber,
labels: context.payload.issue.labels.map(label => label.name), labels: context.payload.issue.labels.map(label => label.name),
}) })
- uses: ./.github/actions/slack-alert
with:
slack_channel_id: ${{ secrets.DOCS_ALERTS_SLACK_CHANNEL_ID }}
slack_token: ${{ secrets.SLACK_DOCS_BOT_TOKEN }}

View File

@@ -33,3 +33,8 @@ jobs:
with: with:
ignore-if-assigned: 'false' ignore-if-assigned: 'false'
remove-labels: 'waiting for review' remove-labels: 'waiting for review'
- uses: ./.github/actions/slack-alert
with:
slack_channel_id: ${{ secrets.DOCS_ALERTS_SLACK_CHANNEL_ID }}
slack_token: ${{ secrets.SLACK_DOCS_BOT_TOKEN }}

View File

@@ -41,3 +41,8 @@ jobs:
} catch(e) { } catch(e) {
console.log(e); console.log(e);
} }
- uses: ./.github/actions/slack-alert
with:
slack_channel_id: ${{ secrets.DOCS_ALERTS_SLACK_CHANNEL_ID }}
slack_token: ${{ secrets.SLACK_DOCS_BOT_TOKEN }}

View File

@@ -29,3 +29,8 @@ jobs:
stale-pr-message: 'This is a gentle bump for the docs team that this PR is waiting for technical review.' stale-pr-message: 'This is a gentle bump for the docs team that this PR is waiting for technical review.'
stale-pr-label: SME stale stale-pr-label: SME stale
days-before-pr-close: -1 # never close days-before-pr-close: -1 # never close
- uses: ./.github/actions/slack-alert
with:
slack_channel_id: ${{ secrets.DOCS_ALERTS_SLACK_CHANNEL_ID }}
slack_token: ${{ secrets.SLACK_DOCS_BOT_TOKEN }}

View File

@@ -25,6 +25,10 @@ jobs:
body: | body: |
Thanks for opening an issue! We've triaged this issue for technical review by a subject matter expert :eyes: Thanks for opening an issue! We've triaged this issue for technical review by a subject matter expert :eyes:
- uses: ./.github/actions/slack-alert
with:
slack_channel_id: ${{ secrets.DOCS_ALERTS_SLACK_CHANNEL_ID }}
slack_token: ${{ secrets.SLACK_DOCS_BOT_TOKEN }}
add-pr-comment: add-pr-comment:
if: ${{ github.repository == 'github/docs' && (github.event.label.name == 'needs SME' && github.event_name == 'pull_request_target') }} if: ${{ github.repository == 'github/docs' && (github.event.label.name == 'needs SME' && github.event_name == 'pull_request_target') }}
runs-on: ubuntu-latest runs-on: ubuntu-latest
@@ -34,3 +38,8 @@ jobs:
issue-number: ${{ github.event.pull_request.number }} issue-number: ${{ github.event.pull_request.number }}
body: | body: |
Thanks for opening a pull request! We've triaged this issue for technical review by a subject matter expert :eyes: Thanks for opening a pull request! We've triaged this issue for technical review by a subject matter expert :eyes:
- uses: ./.github/actions/slack-alert
with:
slack_channel_id: ${{ secrets.DOCS_ALERTS_SLACK_CHANNEL_ID }}
slack_token: ${{ secrets.SLACK_DOCS_BOT_TOKEN }}

View File

@@ -46,3 +46,8 @@ jobs:
to our request for more information from the original author. Please reach out to our request for more information from the original author. Please reach out
if you have the information we requested, or open a [new issue](https://github.com/github/docs/issues/new/choose) if you have the information we requested, or open a [new issue](https://github.com/github/docs/issues/new/choose)
to describing your changes. Then we can begin the review process. to describing your changes. Then we can begin the review process.
- uses: ./.github/actions/slack-alert
with:
slack_channel_id: ${{ secrets.DOCS_ALERTS_SLACK_CHANNEL_ID }}
slack_token: ${{ secrets.SLACK_DOCS_BOT_TOKEN }}

View File

@@ -65,3 +65,8 @@ jobs:
If you don't see updates when expected, try adding a random query string to the URL like `?bla=1234` and see if that helps. If you don't see updates when expected, try adding a random query string to the URL like `?bla=1234` and see if that helps.
If that shows the expected content, it would indicate that the CDN is "overly caching" the page still. It will eventually update, but it can take a while. If that shows the expected content, it would indicate that the CDN is "overly caching" the page still. It will eventually update, but it can take a while.
edit-mode: replace edit-mode: replace
- uses: ./.github/actions/slack-alert
with:
slack_channel_id: ${{ secrets.DOCS_ALERTS_SLACK_CHANNEL_ID }}
slack_token: ${{ secrets.SLACK_DOCS_BOT_TOKEN }}

View File

@@ -62,3 +62,8 @@ jobs:
} catch(e) { } catch(e) {
console.log(e); console.log(e);
} }
- uses: ./.github/actions/slack-alert
with:
slack_channel_id: ${{ secrets.DOCS_ALERTS_SLACK_CHANNEL_ID }}
slack_token: ${{ secrets.SLACK_DOCS_BOT_TOKEN }}

View File

@@ -50,3 +50,8 @@ jobs:
src/versions/scripts/create-enterprise-issue.js deprecation src/versions/scripts/create-enterprise-issue.js deprecation
env: env:
GITHUB_TOKEN: ${{ secrets.DOCS_BOT_PAT_WRITEORG_PROJECT }} GITHUB_TOKEN: ${{ secrets.DOCS_BOT_PAT_WRITEORG_PROJECT }}
- uses: ./.github/actions/slack-alert
with:
slack_channel_id: ${{ secrets.DOCS_ALERTS_SLACK_CHANNEL_ID }}
slack_token: ${{ secrets.SLACK_DOCS_BOT_TOKEN }}

View File

@@ -70,3 +70,8 @@ jobs:
git push git push
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- uses: ./.github/actions/slack-alert
with:
slack_channel_id: ${{ secrets.DOCS_ALERTS_SLACK_CHANNEL_ID }}
slack_token: ${{ secrets.SLACK_DOCS_BOT_TOKEN }}

View File

@@ -68,11 +68,7 @@ jobs:
--repo github/docs-internal \ --repo github/docs-internal \
--label docs-content-fr --label docs-content-fr
- name: Send Slack notification if workflow fails - uses: ./.github/actions/slack-alert
uses: someimportantcompany/github-actions-slack-message@1d367080235edfa53df415bd8e0bbab480f29bad
if: ${{ failure() && env.FREEZE != 'true' }}
with: with:
channel: ${{ secrets.DOCS_ALERTS_SLACK_CHANNEL_ID }} slack_channel_id: ${{ secrets.DOCS_ALERTS_SLACK_CHANNEL_ID }}
bot-token: ${{ secrets.SLACK_DOCS_BOT_TOKEN }} slack_token: ${{ secrets.SLACK_DOCS_BOT_TOKEN }}
color: failure
text: The last "Orphaned assets check" run for ${{github.repository}} failed. See https://github.com/${{github.repository}}/actions/workflows/orphaned-assets-check.yml

View File

@@ -65,3 +65,8 @@ jobs:
ITEM_NODE_ID: ${{ github.event.pull_request.node_id || github.event.issue.node_id }} ITEM_NODE_ID: ${{ github.event.pull_request.node_id || github.event.issue.node_id }}
AUTHOR_LOGIN: ${{ github.event.pull_request.user.login || github.event.issue.user.login }} AUTHOR_LOGIN: ${{ github.event.pull_request.user.login || github.event.issue.user.login }}
REPO: ${{ github.repository }} REPO: ${{ github.repository }}
- uses: ./.github/actions/slack-alert
with:
slack_channel_id: ${{ secrets.DOCS_ALERTS_SLACK_CHANNEL_ID }}
slack_token: ${{ secrets.SLACK_DOCS_BOT_TOKEN }}

View File

@@ -51,3 +51,8 @@ jobs:
# running `git status` should # running `git status` should
# say "nothing to commit, working tree clean". # say "nothing to commit, working tree clean".
git diff --exit-code git diff --exit-code
- uses: ./.github/actions/slack-alert
with:
slack_channel_id: ${{ secrets.DOCS_ALERTS_SLACK_CHANNEL_ID }}
slack_token: ${{ secrets.SLACK_DOCS_BOT_TOKEN }}

View File

@@ -47,3 +47,8 @@ jobs:
env: env:
LANGUAGES: ${{ inputs.languages }} LANGUAGES: ${{ inputs.languages }}
run: src/languages/scripts/purge-fastly-edge-cache-per-language.js run: src/languages/scripts/purge-fastly-edge-cache-per-language.js
- uses: ./.github/actions/slack-alert
with:
slack_channel_id: ${{ secrets.DOCS_ALERTS_SLACK_CHANNEL_ID }}
slack_token: ${{ secrets.SLACK_DOCS_BOT_TOKEN }}

View File

@@ -33,11 +33,7 @@ jobs:
GITHUB_TOKEN: ${{ secrets.DOCS_BOT_PAT_WORKFLOW_READORG }} GITHUB_TOKEN: ${{ secrets.DOCS_BOT_PAT_WORKFLOW_READORG }}
run: src/workflows/purge-old-deployment-environments.js run: src/workflows/purge-old-deployment-environments.js
- name: Send Slack notification if workflow fails - uses: ./.github/actions/slack-alert
uses: someimportantcompany/github-actions-slack-message@1d367080235edfa53df415bd8e0bbab480f29bad
if: ${{ failure() && env.FREEZE != 'true' }}
with: with:
channel: ${{ secrets.DOCS_ALERTS_SLACK_CHANNEL_ID }} slack_channel_id: ${{ secrets.DOCS_ALERTS_SLACK_CHANNEL_ID }}
bot-token: ${{ secrets.SLACK_DOCS_BOT_TOKEN }} slack_token: ${{ secrets.SLACK_DOCS_BOT_TOKEN }}
color: failure
text: The last "Purge old deployment environments" run for ${{github.repository}} failed. See https://github.com/${{github.repository}}/actions/workflows/purge-old-deployment-environments.yml

View File

@@ -30,11 +30,7 @@ jobs:
GITHUB_TOKEN: ${{ secrets.DOCS_BOT_PAT_WORKFLOW_READORG }} GITHUB_TOKEN: ${{ secrets.DOCS_BOT_PAT_WORKFLOW_READORG }}
run: src/workflows/purge-old-workflow-runs.js run: src/workflows/purge-old-workflow-runs.js
- name: Send Slack notification if workflow fails - uses: ./.github/actions/slack-alert
uses: someimportantcompany/github-actions-slack-message@1d367080235edfa53df415bd8e0bbab480f29bad
if: ${{ failure() && env.FREEZE != 'true' }}
with: with:
channel: ${{ secrets.DOCS_ALERTS_SLACK_CHANNEL_ID }} slack_channel_id: ${{ secrets.DOCS_ALERTS_SLACK_CHANNEL_ID }}
bot-token: ${{ secrets.SLACK_DOCS_BOT_TOKEN }} slack_token: ${{ secrets.SLACK_DOCS_BOT_TOKEN }}
color: failure
text: The last "Purge old workflow runs" run for ${{github.repository}} failed. See https://github.com/${{github.repository}}/actions/workflows/purge-old-workflow-runs.yml

View File

@@ -52,3 +52,8 @@ jobs:
action-token: ${{ secrets.DOCS_BOT_PAT_WORKFLOW_READORG }} action-token: ${{ secrets.DOCS_BOT_PAT_WORKFLOW_READORG }}
project-url: 'https://github.com/orgs/github/projects/1367' project-url: 'https://github.com/orgs/github/projects/1367'
column-name: 'Docs-internal external contributor PRs' column-name: 'Docs-internal external contributor PRs'
- uses: ./.github/actions/slack-alert
with:
slack_channel_id: ${{ secrets.DOCS_ALERTS_SLACK_CHANNEL_ID }}
slack_token: ${{ secrets.SLACK_DOCS_BOT_TOKEN }}

View File

@@ -28,3 +28,8 @@ jobs:
env: env:
GITHUB_TOKEN: ${{secrets.DOCS_BOT_PAT_WORKFLOW_READORG}} GITHUB_TOKEN: ${{secrets.DOCS_BOT_PAT_WORKFLOW_READORG}}
PR_URL: https://github.com/${{ github.event.client_payload.command.repository.full_name }}/pull/${{ github.event.client_payload.command.resource.number }} PR_URL: https://github.com/${{ github.event.client_payload.command.repository.full_name }}/pull/${{ github.event.client_payload.command.resource.number }}
- uses: ./.github/actions/slack-alert
with:
slack_channel_id: ${{ secrets.DOCS_ALERTS_SLACK_CHANNEL_ID }}
slack_token: ${{ secrets.SLACK_DOCS_BOT_TOKEN }}

View File

@@ -34,3 +34,8 @@ jobs:
run: | run: |
echo 'Merges into the "main" branch on this repo are currently paused!' echo 'Merges into the "main" branch on this repo are currently paused!'
exit 1 exit 1
- uses: ./.github/actions/slack-alert
with:
slack_channel_id: ${{ secrets.DOCS_ALERTS_SLACK_CHANNEL_ID }}
slack_token: ${{ secrets.SLACK_DOCS_BOT_TOKEN }}

View File

@@ -51,11 +51,8 @@ jobs:
core.setFailed('Repo sync appears to be stalled') core.setFailed('Repo sync appears to be stalled')
} }
}) })
- name: Send Slack notification if workflow fails
uses: someimportantcompany/github-actions-slack-message@1d367080235edfa53df415bd8e0bbab480f29bad - uses: ./.github/actions/slack-alert
if: ${{ failure() }}
with: with:
channel: ${{ secrets.DOCS_ALERTS_SLACK_CHANNEL_ID }} slack_channel_id: ${{ secrets.DOCS_ALERTS_SLACK_CHANNEL_ID }}
bot-token: ${{ secrets.SLACK_DOCS_BOT_TOKEN }} slack_token: ${{ secrets.SLACK_DOCS_BOT_TOKEN }}
color: failure
text: Repo sync appears to be stalled for ${{github.repository}}. See https://github.com/${{github.repository}}/pulls?q=is%3Apr+is%3Aopen+label%3Aautomated-reposync-pr

View File

@@ -136,11 +136,7 @@ jobs:
// Error loud here, so no try/catch // Error loud here, so no try/catch
console.log('Merged the pull request successfully') console.log('Merged the pull request successfully')
- name: Send Slack notification if workflow fails - uses: ./.github/actions/slack-alert
if: failure()
uses: someimportantcompany/github-actions-slack-message@1d367080235edfa53df415bd8e0bbab480f29bad
with: with:
channel: ${{ secrets.DOCS_ALERTS_SLACK_CHANNEL_ID }} slack_channel_id: ${{ secrets.DOCS_ALERTS_SLACK_CHANNEL_ID }}
bot-token: ${{ secrets.SLACK_DOCS_BOT_TOKEN }} slack_token: ${{ secrets.SLACK_DOCS_BOT_TOKEN }}
color: failure
text: The last repo-sync run for ${{github.repository}} failed. See https://github.com/${{github.repository}}/actions/workflows/repo-sync.yml

View File

@@ -41,3 +41,8 @@ jobs:
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PR: ${{ github.event.pull_request.html_url }} PR: ${{ github.event.pull_request.html_url }}
- uses: ./.github/actions/slack-alert
with:
slack_channel_id: ${{ secrets.DOCS_ALERTS_SLACK_CHANNEL_ID }}
slack_token: ${{ secrets.SLACK_DOCS_BOT_TOKEN }}

View File

@@ -28,3 +28,8 @@ jobs:
Before merging, please remember to change the title of this PR to a description of its changes that is suitable for public viewing on github/site-policy. Before merging, please remember to change the title of this PR to a description of its changes that is suitable for public viewing on github/site-policy.
<@github/site-policy-admins>, when these changes are ready to be synced to the site policy repo for the 24-hour or 30-day [review window](https://github.com/github/site-policy#whats-the-process), run the [site policy sync action](https://github.com/github/docs-internal/actions/workflows/site-policy-sync.yml) from this PR's branch. When these changes are ready to be merged in `docs-internal`, let the Docs team know on Slack in #docs-content and a writer will merge this PR. <@github/site-policy-admins>, when these changes are ready to be synced to the site policy repo for the 24-hour or 30-day [review window](https://github.com/github/site-policy#whats-the-process), run the [site policy sync action](https://github.com/github/docs-internal/actions/workflows/site-policy-sync.yml) from this PR's branch. When these changes are ready to be merged in `docs-internal`, let the Docs team know on Slack in #docs-content and a writer will merge this PR.
- uses: ./.github/actions/slack-alert
with:
slack_channel_id: ${{ secrets.DOCS_ALERTS_SLACK_CHANNEL_ID }}
slack_token: ${{ secrets.SLACK_DOCS_BOT_TOKEN }}

View File

@@ -67,3 +67,8 @@ jobs:
else else
echo "No updates to push to the public repo" echo "No updates to push to the public repo"
fi fi
- uses: ./.github/actions/slack-alert
with:
slack_channel_id: ${{ secrets.DOCS_ALERTS_SLACK_CHANNEL_ID }}
slack_token: ${{ secrets.SLACK_DOCS_BOT_TOKEN }}

View File

@@ -30,3 +30,8 @@ jobs:
exempt-issue-labels: 'never-stale,help wanted,waiting for review' exempt-issue-labels: 'never-stale,help wanted,waiting for review'
operations-per-run: 1000 operations-per-run: 1000
close-issue-reason: not_planned close-issue-reason: not_planned
- uses: ./.github/actions/slack-alert
with:
slack_channel_id: ${{ secrets.DOCS_ALERTS_SLACK_CHANNEL_ID }}
slack_token: ${{ secrets.SLACK_DOCS_BOT_TOKEN }}

View File

@@ -109,11 +109,7 @@ jobs:
gh auth login --with-token <<< "${{ secrets.DOCS_BOT_PAT_WORKFLOW_READORG }}" gh auth login --with-token <<< "${{ secrets.DOCS_BOT_PAT_WORKFLOW_READORG }}"
gh pr merge --auto --delete-branch gh pr merge --auto --delete-branch
- name: Send Slack notification if workflow fails - uses: ./.github/actions/slack-alert
uses: someimportantcompany/github-actions-slack-message@1d367080235edfa53df415bd8e0bbab480f29bad
if: ${{ failure() && env.FREEZE != 'true' }}
with: with:
channel: ${{ secrets.DOCS_ALERTS_SLACK_CHANNEL_ID }} slack_channel_id: ${{ secrets.DOCS_ALERTS_SLACK_CHANNEL_ID }}
bot-token: ${{ secrets.SLACK_DOCS_BOT_TOKEN }} slack_token: ${{ secrets.SLACK_DOCS_BOT_TOKEN }}
color: failure
text: The last sync-audit-logs run for ${{github.repository}} failed. See https://github.com/${{github.repository}}/actions/workflows/sync-audit-logs.yml

View File

@@ -122,11 +122,7 @@ jobs:
--repo github/docs-internal \ --repo github/docs-internal \
--label codeql-cli-pipeline --label codeql-cli-pipeline
- name: Send Slack notification if workflow fails - uses: ./.github/actions/slack-alert
uses: someimportantcompany/github-actions-slack-message@1d367080235edfa53df415bd8e0bbab480f29bad
if: ${{ failure() && env.FREEZE != 'true' }}
with: with:
channel: ${{ secrets.DOCS_ALERTS_SLACK_CHANNEL_ID }} slack_channel_id: ${{ secrets.DOCS_ALERTS_SLACK_CHANNEL_ID }}
bot-token: ${{ secrets.SLACK_DOCS_BOT_TOKEN }} slack_token: ${{ secrets.SLACK_DOCS_BOT_TOKEN }}
color: failure
text: The last Sync CodeQL CLI run for ${{github.repository}} failed. See https://github.com/${{github.repository}}/actions/workflows/sync-codeql-cli.yml

View File

@@ -80,11 +80,8 @@ jobs:
with: with:
github-token: ${{ secrets.GITHUB_TOKEN }} github-token: ${{ secrets.GITHUB_TOKEN }}
number: ${{ steps.create-pull-request.outputs.pull-request-number }} number: ${{ steps.create-pull-request.outputs.pull-request-number }}
- name: Send Slack notification if workflow fails
uses: someimportantcompany/github-actions-slack-message@1d367080235edfa53df415bd8e0bbab480f29bad - uses: ./.github/actions/slack-alert
if: ${{ failure() && env.FREEZE != 'true' }}
with: with:
channel: ${{ secrets.DOCS_ALERTS_SLACK_CHANNEL_ID }} slack_channel_id: ${{ secrets.DOCS_ALERTS_SLACK_CHANNEL_ID }}
bot-token: ${{ secrets.SLACK_DOCS_BOT_TOKEN }} slack_token: ${{ secrets.SLACK_DOCS_BOT_TOKEN }}
color: failure
text: The last sync-graphql run for ${{github.repository}} failed. See https://github.com/${{github.repository}}/actions/workflows/sync-graphql.yml

View File

@@ -117,11 +117,7 @@ jobs:
--repo github/docs-internal \ --repo github/docs-internal \
--label github-openapi-bot --label github-openapi-bot
- name: Send Slack notification if workflow fails - uses: ./.github/actions/slack-alert
uses: someimportantcompany/github-actions-slack-message@1d367080235edfa53df415bd8e0bbab480f29bad
if: ${{ failure() && env.FREEZE != 'true' }}
with: with:
channel: ${{ secrets.DOCS_ALERTS_SLACK_CHANNEL_ID }} slack_channel_id: ${{ secrets.DOCS_ALERTS_SLACK_CHANNEL_ID }}
bot-token: ${{ secrets.SLACK_DOCS_BOT_TOKEN }} slack_token: ${{ secrets.SLACK_DOCS_BOT_TOKEN }}
color: failure
text: The last Sync OpenAPI schema run for ${{github.repository}} failed. See https://github.com/${{github.repository}}/actions/workflows/sync-openapi.yml

View File

@@ -84,6 +84,10 @@ jobs:
- name: Debug output - name: Debug output
run: echo "${{ steps.set-matrix.outputs.result }}" run: echo "${{ steps.set-matrix.outputs.result }}"
- uses: ./.github/actions/slack-alert
with:
slack_channel_id: ${{ secrets.DOCS_ALERTS_SLACK_CHANNEL_ID }}
slack_token: ${{ secrets.SLACK_DOCS_BOT_TOKEN }}
updateElasticsearchIndexes: updateElasticsearchIndexes:
needs: figureOutMatrix needs: figureOutMatrix
name: Update indexes name: Update indexes
@@ -205,11 +209,7 @@ jobs:
FASTLY_SURROGATE_KEY: api-search:${{ matrix.language }} FASTLY_SURROGATE_KEY: api-search:${{ matrix.language }}
run: src/workflows/purge-fastly-edge-cache.js run: src/workflows/purge-fastly-edge-cache.js
- name: Send Slack notification if workflow fails - uses: ./.github/actions/slack-alert
uses: someimportantcompany/github-actions-slack-message@1d367080235edfa53df415bd8e0bbab480f29bad
if: failure()
with: with:
channel: ${{ secrets.DOCS_ALERTS_SLACK_CHANNEL_ID }} slack_channel_id: ${{ secrets.DOCS_ALERTS_SLACK_CHANNEL_ID }}
bot-token: ${{ secrets.SLACK_DOCS_BOT_TOKEN }} slack_token: ${{ secrets.SLACK_DOCS_BOT_TOKEN }}
color: failure
text: The last 'Sync search Elasticsearch' run failed. See https://github.com/${{github.repository}}/actions/workflows/sync-search-elasticsearch.yml?query=workflow%3A%22sync+search%22

View File

@@ -111,3 +111,8 @@ jobs:
run: | run: |
curl --fail --retry-connrefused --retry 5 ${{ env.ELASTICSEARCH_URL }}/_cat/indices?v curl --fail --retry-connrefused --retry 5 ${{ env.ELASTICSEARCH_URL }}/_cat/indices?v
curl --fail --retry-connrefused --retry 5 ${{ env.ELASTICSEARCH_URL }}/_cat/indices?v curl --fail --retry-connrefused --retry 5 ${{ env.ELASTICSEARCH_URL }}/_cat/indices?v
- uses: ./.github/actions/slack-alert
with:
slack_channel_id: ${{ secrets.DOCS_ALERTS_SLACK_CHANNEL_ID }}
slack_token: ${{ secrets.SLACK_DOCS_BOT_TOKEN }}

View File

@@ -53,3 +53,8 @@ jobs:
CHANGED_FILES: ${{ steps.changed-files.outputs.modified_files }} CHANGED_FILES: ${{ steps.changed-files.outputs.modified_files }}
DELETED_FILES: ${{ steps.changed-files.outputs.deleted_files }} DELETED_FILES: ${{ steps.changed-files.outputs.deleted_files }}
run: npm test -- src/content-render/tests/render-changed-and-deleted-files.js run: npm test -- src/content-render/tests/render-changed-and-deleted-files.js
- uses: ./.github/actions/slack-alert
with:
slack_channel_id: ${{ secrets.DOCS_ALERTS_SLACK_CHANNEL_ID }}
slack_token: ${{ secrets.SLACK_DOCS_BOT_TOKEN }}

View File

@@ -77,7 +77,7 @@ jobs:
# - tools # - tools
- versions - versions
- webhooks - webhooks
# - workflows - workflows
# The languages suite only runs on docs-internal # The languages suite only runs on docs-internal
isPrivateRepo: isPrivateRepo:
@@ -194,3 +194,8 @@ jobs:
else else
npm test -- src/${{ matrix.name }}/tests/ npm test -- src/${{ matrix.name }}/tests/
fi fi
- uses: ./.github/actions/slack-alert
with:
slack_channel_id: ${{ secrets.DOCS_ALERTS_SLACK_CHANNEL_ID }}
slack_token: ${{ secrets.SLACK_DOCS_BOT_TOKEN }}

View File

@@ -56,3 +56,8 @@ jobs:
env: env:
GITHUB_TOKEN: ${{secrets.DOCS_BOT_PAT_WORKFLOW_READORG}} GITHUB_TOKEN: ${{secrets.DOCS_BOT_PAT_WORKFLOW_READORG}}
OLD_ISSUE: ${{ github.event.issue.html_url }} OLD_ISSUE: ${{ github.event.issue.html_url }}
- uses: ./.github/actions/slack-alert
with:
slack_channel_id: ${{ secrets.DOCS_ALERTS_SLACK_CHANNEL_ID }}
slack_token: ${{ secrets.SLACK_DOCS_BOT_TOKEN }}

View File

@@ -130,12 +130,7 @@ jobs:
run: | run: |
az logout az logout
# Emit a notification for the first responder to triage if the workflow failed. - uses: ./.github/actions/slack-alert
- name: Send Slack notification if workflow failed
uses: someimportantcompany/github-actions-slack-message@1d367080235edfa53df415bd8e0bbab480f29bad
if: failure()
with: with:
channel: ${{ secrets.DOCS_ALERTS_SLACK_CHANNEL_ID }} slack_channel_id: ${{ secrets.DOCS_ALERTS_SLACK_CHANNEL_ID }}
bot-token: ${{ secrets.SLACK_DOCS_BOT_TOKEN }} slack_token: ${{ secrets.SLACK_DOCS_BOT_TOKEN }}
color: failure
text: 'The health report for ${{ matrix.language }} failed.'

View File

@@ -46,3 +46,8 @@ jobs:
with: with:
add-labels: 'triage' add-labels: 'triage'
ignore-if-labeled: true ignore-if-labeled: true
- uses: ./.github/actions/slack-alert
with:
slack_channel_id: ${{ secrets.DOCS_ALERTS_SLACK_CHANNEL_ID }}
slack_token: ${{ secrets.SLACK_DOCS_BOT_TOKEN }}

View File

@@ -23,3 +23,8 @@ jobs:
uses: andymckay/labeler@e6c4322d0397f3240f0e7e30a33b5c5df2d39e90 uses: andymckay/labeler@e6c4322d0397f3240f0e7e30a33b5c5df2d39e90
with: with:
add-labels: 'triage' add-labels: 'triage'
- uses: ./.github/actions/slack-alert
with:
slack_channel_id: ${{ secrets.DOCS_ALERTS_SLACK_CHANNEL_ID }}
slack_token: ${{ secrets.SLACK_DOCS_BOT_TOKEN }}

View File

@@ -24,3 +24,8 @@ jobs:
uses: andymckay/labeler@e6c4322d0397f3240f0e7e30a33b5c5df2d39e90 uses: andymckay/labeler@e6c4322d0397f3240f0e7e30a33b5c5df2d39e90
with: with:
add-labels: 'triage' add-labels: 'triage'
- uses: ./.github/actions/slack-alert
with:
slack_channel_id: ${{ secrets.DOCS_ALERTS_SLACK_CHANNEL_ID }}
slack_token: ${{ secrets.SLACK_DOCS_BOT_TOKEN }}

View File

@@ -30,6 +30,11 @@ jobs:
days-before-pr-close: 3 days-before-pr-close: 3
stale-pr-label: 'stale' stale-pr-label: 'stale'
exempt-pr-labels: 'waiting for review,never-stale,ready to merge' exempt-pr-labels: 'waiting for review,never-stale,ready to merge'
- uses: ./.github/actions/slack-alert
with:
slack_channel_id: ${{ secrets.DOCS_ALERTS_SLACK_CHANNEL_ID }}
slack_token: ${{ secrets.SLACK_DOCS_BOT_TOKEN }}
stale_staff: stale_staff:
if: github.repository == 'github/docs' if: github.repository == 'github/docs'
runs-on: ubuntu-latest runs-on: ubuntu-latest
@@ -49,3 +54,8 @@ jobs:
# we want # we want
stale-pr-label: 'waiting for review' stale-pr-label: 'waiting for review'
exempt-pr-labels: 'never-stale' exempt-pr-labels: 'never-stale'
- uses: ./.github/actions/slack-alert
with:
slack_channel_id: ${{ secrets.DOCS_ALERTS_SLACK_CHANNEL_ID }}
slack_token: ${{ secrets.SLACK_DOCS_BOT_TOKEN }}

View File

@@ -100,3 +100,8 @@ jobs:
} }
core.setFailed(workflowFailMessage) core.setFailed(workflowFailMessage)
- uses: ./.github/actions/slack-alert
with:
slack_channel_id: ${{ secrets.DOCS_ALERTS_SLACK_CHANNEL_ID }}
slack_token: ${{ secrets.SLACK_DOCS_BOT_TOKEN }}

View File

@@ -24,3 +24,8 @@ jobs:
- name: Validate all asset images - name: Validate all asset images
run: src/assets/scripts/validate-asset-images.js run: src/assets/scripts/validate-asset-images.js
- uses: ./.github/actions/slack-alert
with:
slack_channel_id: ${{ secrets.DOCS_ALERTS_SLACK_CHANNEL_ID }}
slack_token: ${{ secrets.SLACK_DOCS_BOT_TOKEN }}

View File

@@ -0,0 +1,72 @@
import { fileURLToPath } from 'url'
import path from 'path'
import fs from 'fs'
import yaml from 'js-yaml'
import { flatten } from 'flat'
import { chain, get } from 'lodash-es'
const actionHashRegexp = /^[A-Za-z0-9-/]+@[0-9a-f]{40}$/
const __dirname = path.dirname(fileURLToPath(import.meta.url))
const workflowsDir = path.join(__dirname, '../../../.github/workflows')
const workflows = fs
.readdirSync(workflowsDir)
.filter((filename) => filename.endsWith('.yml') || filename.endsWith('.yaml'))
.map((filename) => {
const fullpath = path.join(workflowsDir, filename)
const data = yaml.load(fs.readFileSync(fullpath, 'utf8'), { fullpath })
return { filename, fullpath, data }
})
function actionsUsedInWorkflow(workflow) {
return Object.keys(flatten(workflow))
.filter((key) => key.endsWith('.uses'))
.map((key) => get(workflow, key))
}
const allUsedActions = chain(workflows)
.map(actionsUsedInWorkflow)
.flatten()
.uniq()
.filter((use) => !use.startsWith('.'))
.sort()
.value()
const scheduledWorkflows = workflows.filter(({ data }) => data.on.schedule)
const dailyWorkflows = scheduledWorkflows.filter(({ data }) =>
data.on.schedule.find(({ cron }) => /^20 [^*]/.test(cron)),
)
describe('GitHub Actions workflows', () => {
test.each(allUsedActions)('requires specific hash: %p', (actionName) => {
expect(actionName).toMatch(actionHashRegexp)
})
test.each(scheduledWorkflows)(
'schedule workflow runs at 20 minutes past $filename',
({ data }) => {
for (const { cron } of data.on.schedule) {
expect(cron).toMatch(/^20/)
}
},
)
test.each(dailyWorkflows)(
'daily scheduled workflows run at 16:20 UTC / 8:20 PST $filename',
({ data }) => {
for (const { cron } of data.on.schedule) {
const hour = cron.match(/^20 ([^*\s]+)/)[1]
expect(hour).toEqual('16')
}
},
)
test.each(workflows)('workflows slack alert on fail $filename', ({ filename, data }) => {
for (const [name, job] of Object.entries(data.jobs)) {
if (!job.steps.find((step) => step.uses === './.github/actions/slack-alert')) {
throw new Error(`Job ${filename} # ${name} missing slack alert on fail`)
}
}
})
})

View File

@@ -1,58 +0,0 @@
import { fileURLToPath } from 'url'
import path from 'path'
import fs from 'fs'
import yaml from 'js-yaml'
import { flatten } from 'flat'
import { chain, get } from 'lodash-es'
const __dirname = path.dirname(fileURLToPath(import.meta.url))
const workflowsDir = path.join(__dirname, '../../.github/workflows')
const workflows = fs
.readdirSync(workflowsDir)
.filter((filename) => filename.endsWith('.yml') || filename.endsWith('.yaml'))
.map((filename) => {
const fullpath = path.join(workflowsDir, filename)
const data = yaml.load(fs.readFileSync(fullpath, 'utf8'), { fullpath })
return { filename, fullpath, data }
})
function actionsUsedInWorkflow(workflow) {
return Object.keys(flatten(workflow))
.filter((key) => key.endsWith('.uses'))
.map((key) => get(workflow, key))
}
const scheduledWorkflows = workflows
.map((workflow) => workflow.data.on.schedule)
.filter(Boolean)
.flat()
.map((schedule) => schedule.cron)
const allUsedActions = chain(workflows)
.map(actionsUsedInWorkflow)
.flatten()
.uniq()
.filter((use) => !use.startsWith('.'))
.sort()
.value()
describe('GitHub Actions workflows', () => {
test('all used actions are listed', () => {
expect(allUsedActions.length).toBeGreaterThan(0)
})
test.each(allUsedActions)('requires specific hash: %p', (actionName) => {
const actionRegexp = /^[A-Za-z0-9-/]+@[0-9a-f]{40}$/
expect(actionName).toMatch(actionRegexp)
})
test('all scheduled workflows run at 20 minutes past', () => {
const twenties = scheduledWorkflows.filter((schedule) => /^20/.test(schedule))
expect(twenties.length).toEqual(scheduledWorkflows.length)
})
test('all daily and weekly workflows run at 16:20 UTC / 8:20 PST', () => {
const dailies = scheduledWorkflows.filter((schedule) => /^20 \d{2}/.test(schedule))
const sixteens = dailies.filter((schedule) => /^20 16/.test(schedule))
expect(sixteens.length).toEqual(dailies.length)
})
})