π§ SQLMesh Bot π§ #22
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: SQLMesh Bot | |
run-name: π§ SQLMesh Bot π§ | |
on: | |
pull_request: | |
types: | |
- synchronize | |
- opened | |
# Required if using comments to issue commands to the bot | |
# issue_comment: | |
# types: | |
# - created | |
# Required if using required approvers to automate deployments | |
pull_request_review: | |
types: | |
- edited | |
- submitted | |
- dismissed | |
# The latest commit is the one that will be used to create the PR environment and deploy to production | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.head_ref || github.ref_name }} | |
cancel-in-progress: true | |
jobs: | |
sqlmesh: | |
name: SQLMesh Actions | |
runs-on: ubuntu-latest | |
permissions: | |
# Required to access code in PR | |
contents: write | |
# Required to post comments | |
issues: write | |
# Required to update check runs | |
checks: write | |
# Required to merge | |
pull-requests: write | |
steps: | |
- name: Setup Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.12' | |
- name: Checkout PR branch | |
uses: actions/checkout@v4 | |
with: | |
ref: refs/pull/${{ github.event.issue.pull_request && github.event.issue.number || github.event.pull_request.number }}/merge | |
- name: Authenticate to Google Cloud | |
uses: 'google-github-actions/auth@v2' | |
with: | |
credentials_json: '${{ secrets.GOOGLE_SQLMESH_CREDENTIALS }}' | |
- name: Install SQLMesh Enterprise + Dependencies | |
run: | | |
pip install poetry keyring keyrings-google-artifactregistry-auth | |
poetry install --no-root | |
shell: bash | |
- name: Run CI/CD Bot | |
run: | | |
poetry run tcloud sqlmesh_cicd -p ${{ github.workspace }} github --token ${{ secrets.GITHUB_TOKEN }} run-all | |
env: # TODO: update your GitHub secrets to include TCLOUD_TOKEN, GOOGLE_SQLMESH_CREDENTIALS | |
TCLOUD_TOKEN: '${{ secrets.TCLOUD_TOKEN }}' | |
GOOGLE_SQLMESH_CREDENTIALS: ${{ secrets.GOOGLE_SQLMESH_CREDENTIALS }} |