Skip to content
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

feat: create rollout on PR creation #20

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
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
16 changes: 7 additions & 9 deletions .github/workflows/bytebase-upsert-migration.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,17 @@
name: Upsert Migration

on:
pull_request_review:
types: [submitted]
# pull_request:
# branches:
# - main
# paths:
# - "**/*.up.sql"
# pull_request_review:
# types: [submitted]
pull_request:
branches:
- main
paths:
- "**/*.up.sql"

jobs:
bytebase-upsert-migration:
runs-on: ubuntu-latest
# Runs only if PR is approved and target branch is main
if: github.event.review.state == 'approved' && github.event.pull_request.base.ref == 'main'
env:
BYTEBASE_URL: "https://bytebase-ci.zeabur.app"
BYTEBASE_SERVICE_ACCOUNT: "[email protected]"
Expand Down
1 change: 1 addition & 0 deletions migrations/1001_create_user.down.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
DROP TABLE "user";
7 changes: 7 additions & 0 deletions migrations/1001_create_user.up.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
CREATE TABLE "user" (
"id" SERIAL NOT NULL,
"firstName" character varying NOT NULL,
"lastName" character varying NOT NULL,
"age" integer NOT NULL,
CONSTRAINT "PK_cace4a159ff9f2512dd42373760" PRIMARY KEY ("id")
);

Check failure on line 7 in migrations/1001_create_user.up.sql

View workflow job for this annotation

GitHub Actions / SQL Review

Table already exists (607)

The table "user" already exists in the schema "public". https://www.bytebase.com/docs/reference/error-code/advisor#607
1 change: 1 addition & 0 deletions migrations/1002_create_post.down.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
DROP TABLE post;
5 changes: 5 additions & 0 deletions migrations/1002_create_post.up.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
CREATE TABLE "post" (
"id" SERIAL NOT NULL,
"author" TEXT NOT NULL,
CONSTRAINT "PK_cace4a159ff9f2512dd42373761" PRIMARY KEY ("id")
);

Check failure on line 5 in migrations/1002_create_post.up.sql

View workflow job for this annotation

GitHub Actions / SQL Review

Table already exists (607)

The table "post" already exists in the schema "public". https://www.bytebase.com/docs/reference/error-code/advisor#607
Loading