Skip to content
This repository was archived by the owner on Jun 2, 2026. It is now read-only.
Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Repository files navigation

Write into Google BigQuery

Description

This GitHub Action can be used to write data to Google BigQuery from within a GitHub workflow. The GitHub Action authenticates with a Google Cloud Service Account and uses the provided token for writing to BigQuery. It sends a POST request against the insertAllAPI endpoint.

Usage

Note: this action requires actions/checkout to be run first
- name: Checkoutuses: actions/checkout@v4
- name: Collect datarun: | echo "TIMESTAMP=$(date --utc +%FT%T%Z)" >> $GITHUB_ENV- name: Write to DWHuses: Staffbase/bigquery-github-action@v1.1.0with:
credentials_json: ${{ secrets.YOUR_SERVICE_ACCOUNT_KEY }}bigquery_project: bq-your-project-idbigquery_dataset: bq-your-dataset-idbigquery_table: bq-your-table-idpayload_json: '{ "property": "${{ env.TIMESTAMP }} this is a test"}'

Action Spec:

Inputs

InputDescriptionRequired
credentials_jsonThe credentials key for the Service Account user used for authentication in JSON format. This is forwarded to the google-github-actions/auth action.true
token_lifetimeThe lifetime of the generated auth token in seconds. The default is 30s. This is forwarded to the google-github-actions/auth action.false
bigquery_projectThe Project ID of the project to write to.true
bigquery_datasetThe Dataset ID inside the project to write to.true
bigquery_tableThe Table ID inside the dataset to write to.true
payload_jsonThe payload to be written into the referenced table in JSON format. It must reflect the schema of the table. In the above example the property refers to the column name in the table bigquery_table and ${{ env.TIMESTAMP }} this is a test is the value written into that column.true
timestamp_property_to_addA column name in the bigquery_table which is of type TIMESTAMP. If provided the a property with this name and the current timestamp as value (in UTC) is added to payload_json.false

Contributing

Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.

License

This project is licensed under the Apache-2.0 License - see the LICENSE.md file for details.

Staffbase GmbHStaffbase GmbH
Staffbase is an internal communications platform built to revolutionize the way you work and unite your company. Staffbase is hiring: staffbase.com/jobs
GitHub | Website | Jobs

About

GitHub Action for writing data into BigQuery from within a Github workflow

Topics

Resources

Contributing

Stars

6 stars

Watchers

18 watching

Forks

Releases

Packages

Used by

Contributors

Languages