Skip to content

[CSTI] Google Chats PR Announcer #578

[CSTI] Google Chats PR Announcer

[CSTI] Google Chats PR Announcer #578

Workflow file for this run

name: "[CSTI] Google Chats PR Announcer"
on:
workflow_dispatch:
schedule:
# Every morning at 9AM, Mondays to Fridays
- cron: "0 9 * * MON-FRI"
jobs:
# See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#example-defining-outputs-for-a-job
setup:
runs-on: ubuntu-latest
outputs:
repos: ${{ steps.main.outputs.repos }}
steps:
- id: main
run: |
REPOS=(
csnx
CSTI-team
source
fonts
)
RESULT=""
for repo in "${REPOS[@]}"; do
RESULT="$RESULT,guardian/$repo"
done
# remove leading ,
RESULT="${RESULT:1}"
echo "repos=$RESULT" >> $GITHUB_OUTPUT
prnouncer:
runs-on: ubuntu-latest
needs: setup
steps:
- name: Use GitHub App Token
uses: actions/create-github-app-token@v1
id: app-token
with:
# These values are for the GitHub App "Gu PRnouncer config"
# See https://github.com/organizations/guardian/settings/apps/gu-prnouncer-config (only accessible by GitHub owners)
app-id: ${{ secrets.APP_ID }}
private-key: ${{ secrets.PRIVATE_KEY }}
owner: guardian
- uses: guardian/actions-prnouncer@main
with:
google-webhook-url: ${{ secrets.CSTI_GOOGLE_WEBHOOK_URL }}
github-repositories: ${{ needs.setup.outputs.repos }}
github-token: ${{ steps.app-token.outputs.token }} # A GitHub app token generated by the previous step
# Ignore PRs from dependabot, and snyk-bot as there are a LOT of PRs.
# See:
# - https://api.github.com/users/dependabot
# - https://api.github.com/users/renovatebot
# TODO Address these PRs!
github-ignored-users: 49699333,29139614