[DevX SOaR] Google Chats PR Announcer #572
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: "[DevX SOaR] 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: "30 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 | |
# See https://github.com/orgs/guardian/teams/devx-reliability-and-ops/repositories | |
# See https://github.com/orgs/guardian/teams/devx-security/repositories | |
run: | | |
REPOS=( | |
.github | |
actions-prnouncer | |
actions-read-private-repos | |
actions-riff-raff | |
amiable | |
amigo | |
anghammarad | |
anghammarad-config | |
apps-anomaly-detection | |
aws-account-setup | |
cdk | |
cdk-playground | |
cfn-private-resource-types | |
cloudwatch-logs-management | |
cognito-auth-lambdas | |
cq-source-galaxies | |
cq-source-ns1 | |
deploy-tools-platform | |
devx-backup-monitoring | |
devx-config | |
devx-docs | |
devx-logs | |
dns-validation-lambda | |
elastic-search-monitor | |
elasticsearch-node-rotation | |
grafana | |
instance-tag-discovery | |
private-infrastructure-config | |
prism | |
riff-raff | |
riffraff-platform | |
service-catalogue | |
simple-configuration | |
slo-alerts | |
ssm-to-env | |
tracker | |
waf | |
) | |
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.DEVX_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 | |
# By default, guardian/actions-prnouncer doesn't report PRs from Dependabot. Include them here. | |
github-ignored-users: "" | |
show-pr-age: "true" |