Skip to content

report index generator #239

report index generator

report index generator #239

name: 'report index generator'
on:
workflow_dispatch: {}
schedule:
# trigger at 1:42am on Tuesday and Thursday
# set during the hour to reduce collisions
- cron: '42 1 * * 2,4'
permissions:
id-token: write
jobs:
build_report_index:
runs-on: ubuntu-latest
env:
VERSION: 5.2.0
steps:
- id: "google-cloud-auth"
name: "Authenticate to Google Cloud"
uses: google-github-actions/auth@v1
with:
workload_identity_provider: "projects/847315747340/locations/global/workloadIdentityPools/github-pool/providers/github-provider"
service_account: "github@cpg-talos.iam.gserviceaccount.com"
- id: "google-cloud-sdk-setup"
name: "Set up Cloud SDK"
uses: google-github-actions/setup-gcloud@v1
- name: "Submit report crawler"
run: |
TOKEN=$(gcloud auth print-identity-token --impersonate-service-account="github@cpg-talos.iam.gserviceaccount.com" --audiences="https://server-a2pko7ameq-ts.a.run.app" --include-email)
curl --fail --silent --show-error -X POST \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type:application/json" \
-d '{"output": "report_index_${{ steps.date.outputs.date }}", "dataset": "talos", "image": "australia-southeast1-docker.pkg.dev/cpg-common/images/talos:${{ env.VERSION }}", "accessLevel": "full", "repo": "automated-interpretation-pipeline", "commit": "${{ github.sha }}", "cwd": ".", "script": ["BuildReportIndexPage"], "description": "Build Talos Report Index Page", "wait": false}' \
https://server-a2pko7ameq-ts.a.run.app