feat: examples using bytebase-action #1
Workflow file for this run
This file contains hidden or 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: SQL review on pull request using bytebase-action image | |
on: | |
pull_request: | |
branches: | |
- main | |
paths: | |
- "migrations/*.sql" | |
jobs: | |
check-release-on-prod: | |
permissions: | |
pull-requests: write # write permission required to allow the action writes the check results to the comment. | |
runs-on: ubuntu-latest # use self-hosted machines if your Bytebase runs in internal networks. | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Check release | |
uses: docker://bytebase/bytebase-action:latest | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # set GITHUB_TOKEN because the 'Check release' step needs it to comment the pull request with check results. | |
BYTEBASE_URL: https://demo.bytebase.com | |
BYTEBASE_SERVICE_ACCOUNT: [email protected] | |
BYTEBASE_SERVICE_ACCOUNT_SECRET: ${{secrets.BYTEBASE_SERVICE_ACCOUNT_SECRET}} | |
BYTEBASE_PROJECT: "projects/project-sample" | |
BYTEBASE_TARGETS: "instances/prod-sample-instance/databases/hr_prod" | |
FILE_PATTERN: "migrations/*.sql" | |
with: | |
entrypoint: bytebase-action | |
args: check --url ${{ env.BYTEBASE_URL }} --service-account ${{ env.BYTEBASE_SERVICE_ACCOUNT }} --project ${{ env.BYTEBASE_PROJECT }} --targets ${{ env.BYTEBASE_TARGETS }} --file-pattern ${{ env.FILE_PATTERN }} |