You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/docs/tutorials/sql-review-github-action.md
+20-13Lines changed: 20 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,6 +3,7 @@ title: 'SQL Review with GitHub Actions'
3
3
author: Adela
4
4
updated_at: 2025/03/03 18:15
5
5
tags: Tutorial
6
+
integrations: GitHub
6
7
level: Intermediate
7
8
estimated_time: '20 mins'
8
9
description: Learn how to use SQL Review via GitHub CI to enhance your database schema change process.
@@ -20,9 +21,15 @@ This tutorial is part of the SQL Review series:
20
21
21
22
This tutorial will show you how to integrate SQL Review with GitHub Actions to improve your database schema change process.
22
23
23
-
Example repository: [release-cicd-workflows-example](https://github.com/bytebase/release-cicd-workflows-example).
24
+
<HintBlocktype="info">
24
25
25
-
For detailed steps on setting up SQL Review in conjunction with database release CI/CD using GitHub Actions, refer to the [Database Release CI/CD with GitHub Actions](/docs/tutorials/github-release-cicd-workflow/) tutorial.
26
+
This tutorial code repository is at https://github.com/bytebase/release-cicd-workflows-example
27
+
28
+
</HintBlock>
29
+
30
+
## Prerequisites
31
+
32
+
Configure ngrok and create service account same as [Database Release CI/CD with GitHub Actions](/docs/tutorials/github-release-cicd-workflow/#step-1-start-bytebase-with-ngrok).
26
33
27
34
## GitHub Action Workflow
28
35
@@ -31,12 +38,12 @@ This [bytebase-check-release.yml](https://github.com/bytebase/release-cicd-workf
The deployment target is the database that the SQL files will be applied to. So the SQL Review policy is fetched based on the target database. Visit the [demo sql review policy page](https://demo.bytebase.com/sql-review) to see the `SQL Review Sample Policy` for the `Prod` environment.
@@ -45,23 +52,23 @@ The deployment target is the database that the SQL files will be applied to. So
45
52
46
53
## Example PR
47
54
48
-
[Example PR](https://github.com/bytebase/release-cicd-workflows-example/pull/4)cointains four sql files in the `migrations` folder:
55
+
[Example PR](https://github.com/bytebase/release-cicd-workflows-example/pull/4) contains four sql files in the `migrations` folder:
49
56
50
57
- `001__drop_dept_emp.sql`
51
58
- `002__add_employee_phone.sql`
52
59
- `003__update_employee_gender.sql`
53
60
- `004__create_book.sql`
54
61
55
-
Upon PR creation, the GitHub Action triggers SQL Review. A summary, including affected rows, risk level, and advice, is posted as a PR comment. With four files and two stages, there are eight lines of review results.
62
+
Upon PR creation, the GitHub Action triggers SQL Review. A summary, including **affected rows**, **risk level**, and **advices**, is posted as a PR comment. With four files and two stages, there are eight lines of review results.
You may correct the SQL files and push again. The SQL Review will be performed again and the results will be updated.
70
+
You may correct the SQL files and push again. The SQL Review will be triggered again and the results will be updated.
64
71
65
72
## Summary
66
73
67
-
Now you have learned how to trigger SQL Review in GitHub Actions, you may also refer to the [SQL Review](/docs/sql-review/overview) document for more details.
74
+
Now you have learned how to trigger SQL Review in GitHub Actions, you may also refer to the [SQL Review](/docs/sql-review/overview) document for more details.
0 commit comments