Skip to content

test action #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Apr 17, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions .github/workflows/sql-review-action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
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"
3 changes: 3 additions & 0 deletions migrations/202504171429_1.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
CREATE TABLE IF NOT EXISTS wer (

Check warning on line 1 in migrations/202504171429_1.sql

View workflow job for this annotation

GitHub Actions / check-release-on-prod

column.no-null (402)

Column "id" in "public"."wer" cannot have NULL value. Targets: instances/prod-sample-instance/databases/hr_prod https://www.bytebase.com/docs/reference/error-code/advisor#402
id int

Check failure on line 2 in migrations/202504171429_1.sql

View workflow job for this annotation

GitHub Actions / check-release-on-test

table.require-pk (601)

Table "public"."wer" requires PRIMARY KEY, related statement: "CREATE TABLE IF NOT EXISTS wer (\n id int\n);". Targets: instances/test-sample-instance/databases/hr_test https://www.bytebase.com/docs/reference/error-code/advisor#601
);
3 changes: 3 additions & 0 deletions migrations/202504171526_2.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
CREATE TABLE IF NOT EXISTS oijoir (

Check warning on line 1 in migrations/202504171526_2.sql

View workflow job for this annotation

GitHub Actions / check-release-on-prod

column.no-null (402)

Column "id" in "public"."oijoir" cannot have NULL value. Targets: instances/prod-sample-instance/databases/hr_prod https://www.bytebase.com/docs/reference/error-code/advisor#402
id int

Check failure on line 2 in migrations/202504171526_2.sql

View workflow job for this annotation

GitHub Actions / check-release-on-test

table.require-pk (601)

Table "public"."oijoir" requires PRIMARY KEY, related statement: "CREATE TABLE IF NOT EXISTS oijoir (\n id int\n);". Targets: instances/test-sample-instance/databases/hr_test https://www.bytebase.com/docs/reference/error-code/advisor#601
);
Loading