bq2slack-github-action

Send slack notification with BQ results.

How to use

Sample github actions workflow yaml

name: Run SQL against BQ and notify slack
on:
  schedule:
    - cron:  '0 10 * * *' # run every day at 10:00

jobs:
  bq2slack:
    runs-on: ubuntu-latest
    name: Execute SQL query and send results to Slack
    steps:
      - name: Run
        uses: data-i-consulting/[email protected] # use the latest tag
        with:
          slack_webhook: ${{secrets.SLACK_WEBHOOK}}
          gcp_service_account: ${{secrets.GCP_SERVICE_ACCOUNT}}
          sql: |
            WITH something AS (
              SELECT 1 as my_number
            )

            SELECT * FROM something

Sample output

Screen Shot 2022-02-12 at 2 41 48

Development

npm i
npm run start

Build

npm i
npm run build

GitHub

View Github