Skip to content

Notify about production deployment #2

Notify about production deployment

Notify about production deployment #2

name: Notify about production deployment
# **What it does**: Posts a comment on every PR in the deploy that got into
# production. The merge queue can batch several PRs into one
# deploy, so it walks back from the deployed commit to find
# all of them.
# **Why we have it**: So that the PR author can be informed when their merged PR is in production.
# **Who does it impact**: Writers
on:
workflow_dispatch:
workflow_run:
workflows: ['Purge Fastly']
types:
- completed
permissions:
contents: read
pull-requests: write
jobs:
find-pr-and-post-comment:
if: >-
${{
github.repository == 'github/docs-internal' &&
(github.event_name != 'workflow_run' ||
github.event.workflow_run.conclusion == 'success')
}}
runs-on: ubuntu-latest
steps:
- name: Check out repo
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- uses: ./.github/actions/node-npm-setup
# The "Purge Fastly" action takes about 6 minutes to purge all
# languages. First does the language agnostic URLs, then English,
# then all the other languages.
# So it takes about ~30 seconds until it has sent the purge for
# all English docs.
- name: Sleep a little to give Fastly Purge a chance
run: sleep 30
- name: Find PRs and post production comments
timeout-minutes: 5
env:
GITHUB_TOKEN: ${{ secrets.DOCS_BOT_PAT_BASE }}
run: npm run find-past-built-pr
- uses: ./.github/actions/slack-alert
if: ${{ failure() }}
with:
slack_token: ${{ secrets.SLACK_DOCS_BOT_TOKEN }}
- uses: ./.github/actions/create-workflow-failure-issue
if: ${{ failure() }}
with:
token: ${{ secrets.DOCS_BOT_PAT_BASE }}