[Data Design] Google Chats PR Announcer #4
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: "[Data Design] Google Chats PR Announcer" | |
on: | |
workflow_dispatch: | |
schedule: | |
# Every Tuesday and Thursday at 10:30AM UTC | |
# See https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#schedule | |
- cron: "30 10 * * TUE,THU" | |
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-security/repositories | |
run: | | |
REPOS=( | |
data-platform-models | |
ophan-data-lake | |
gcp-iac-terraform | |
) | |
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.DATA_DESIGN_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 | |
github-ignored-labels: "Stale, Draft" | |
# We only want members of DD team. We can look at automating this in future. | |
github-announced-users: "75612679,91878054,118352929,66588171,43630793,8862634" | |
show-pr-age: "true" |