Skip to content

Comment Hub Deployment Plan to a Pull Request #5174

Comment Hub Deployment Plan to a Pull Request

Comment Hub Deployment Plan to a Pull Request #5174

name: Comment Hub Deployment Plan to a Pull Request
on:
workflow_run:
workflows:
- "Deploy and test hubs"
types:
- "completed"
jobs:
# This job downloads artifacts generated by the "Deploy and test hubs" workflow.
# The artifacts generated are two files: one containing the Pull Request number of the
# run, and a second containing Markdown tables detailing which hubs will be upgraded as
# a result of merging a Pull Request. This Markdown content will be posted to the
# Pull Request as a comment. This means that no-one has to go searching through
# GitHub Actions logs to see if the hubs they intended to be upgraded, will be
# upgraded. The job posts the comment in a 'Netlify style', i.e., if a comment has
# already been posted (identified as having the 'github-actions[bot]' author and
# '<!-- deployment-plan -->' string in the body), the existing comment will be
# updated rather than posting a new one.
post-deployment-plan:
runs-on: ubuntu-latest
# Only run this job if the workflow that triggered it was from a Pull Request and
# completed successfully
if: >
github.event.workflow_run.event == 'pull_request' &&
github.event.workflow_run.conclusion == 'success'
# Give GITHUB_TOKEN enough permissions to read actions artifacts, issue comments and
# post/update comments on Pull Requests
permissions:
actions: read
issues: read
pull-requests: write
steps:
- uses: actions/checkout@v4
- run: pip install requests
- run: python extra-scripts/comment-deployment-plan-pr.py
env:
GITHUB_REPOSITORY: ${{ github.repository }}
RUN_ID: ${{ github.event.workflow_run.id }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}