main
localhost:8080
.
<<YOURS>>.ngrok-free.app
.
https://<<YOURS>>.ngrok-free.app
.
https://<<YOURS>>.ngrok-free.app
as the External URL and click Confirm and update.
Workspace Admin
, and go to IAM & Admin > Users & Groups. Click + Add User, fill in with api-sample
, choose the Workspace DBA
role sufficient for this tutorial and click Confirm.
Sample Template
and click Next.
Prod
environment as the attached resources and click Confirm. Now the SQL review is enabled for the Prod
environment.
.github/workflows/sql-review-action.yml
: Lint the SQL migration files after the PR is created..github/workflows/release-action.yml
: Create a release in Bytebase after the PR is merged to the main
branch..github/workflows/release-action.yml
and .github/workflows/sql-review-action.yml
. In the env
section, replace the variable values with your own and commit the changes.
api-example@service.bytebase.com
(the service account you created in the previous step)projects/project-sample
(the sample project in the Bytebase)instances/test-sample-instance/databases/hr_test,instances/prod-sample-instance/databases/hr_prod
(the two default databases in the sample project)migrations-semver/*.sql
(the pattern of the migration files)${{secrets.BYTEBASE_SERVICE_ACCOUNT_SECRET}}
. Go to Settings > Secrets and Variables > Actions, click New repository secret, and add BYTEBASE_SERVICE_ACCOUNT_SECRET.
.github/workflows/sql-review-action.yml
, the GITHUB_TOKEN
(${{ secrets.GITHUB_TOKEN }}
) is included to allow the workflow to comment on pull requests with the Check release
results. You don’t need to configure it manually — GitHub provides it automatically during workflow execution.
202503131500_create_table_t1_ddl.sql
, you can also use semantic versioning like 1.0.0_create_table_t1_ddl.sql
.migrations
directory:
sql-review-action
workflow will be triggered. There will be a warning in the SQL review result. Go into the File changes tab, you can see the warning.
release-action
workflow will be triggered to create a release in Bytebase and then roll out automatically. Go to Actions tab, you can see the workflow run and pass.
main
branch.