Skip to content

[Identity & Trust] Google Chats PR Announcer #150

[Identity & Trust] Google Chats PR Announcer

[Identity & Trust] Google Chats PR Announcer #150

name: "[Identity & Trust] Google Chats PR Announcer"
on:
workflow_dispatch:
schedule:
# Every morning at 9:30AM UTC (10:30AM BST), Mondays to Fridays
# See https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#schedule
- cron: "0 8 * * 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
# Generated by running the following query in the service-catalogue database:
# SELECT short_repo_name FROM view_repo_ownership WHERE (github_team_name = 'Identity' OR github_team_name = 'Discussion' OR github_team_name = 'Transparency & Consent') AND NOT archived
run: |
REPOS=(
baton
baton-lambda-template
cmp-market-research
consent-management-platform
discussion-api
discussion-avatar
discussion-elasticsearch
discussion-modtools
discussion-platform
dynamo-db-switches
gatehouse
gateway
grl
hmac-headers
identity
identity-account-deletion
identity-admin
identity-admin-api
identity-data-retention
identity-platform
identity-processes
identity-test-users
social-sign-in
transparency-consent-docs
)
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.IDENTITY_AND_TRUST_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 Scala Steward as there are a LOT of PRs.
# See:
# - https://github.com/apps/gu-scala-steward-private-repos
# - https://github.com/apps/gu-scala-steward-public-repos
# TODO: Improve testing of Scala projects and merge these PRs
github-ignored-users: 108136057,108460179
show-pr-age: "true"