From 066d34d8ef117af0f0fa401226bcad71e70bf7ce Mon Sep 17 00:00:00 2001 From: huynn0x Date: Tue, 15 Apr 2025 14:59:40 +0700 Subject: [PATCH 1/3] Create SECURITY.md --- SECURITY.md | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 SECURITY.md diff --git a/SECURITY.md b/SECURITY.md new file mode 100644 index 0000000..034e848 --- /dev/null +++ b/SECURITY.md @@ -0,0 +1,21 @@ +# Security Policy + +## Supported Versions + +Use this section to tell people about which versions of your project are +currently being supported with security updates. + +| Version | Supported | +| ------- | ------------------ | +| 5.1.x | :white_check_mark: | +| 5.0.x | :x: | +| 4.0.x | :white_check_mark: | +| < 4.0 | :x: | + +## Reporting a Vulnerability + +Use this section to tell people how to report a vulnerability. + +Tell them where to go, how often they can expect to get an update on a +reported vulnerability, what to expect if the vulnerability is accepted or +declined, etc. From b100824e51804fe7b018798e7b5c55c7b9bb076f Mon Sep 17 00:00:00 2001 From: huynn0x Date: Tue, 15 Apr 2025 15:09:40 +0700 Subject: [PATCH 2/3] Update sql-review.yml --- .github/workflows/sql-review.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/sql-review.yml b/.github/workflows/sql-review.yml index 59c0fbf..af2ec22 100644 --- a/.github/workflows/sql-review.yml +++ b/.github/workflows/sql-review.yml @@ -14,10 +14,10 @@ jobs: runs-on: ubuntu-latest # use self-hosted machines if your Bytebase runs in internal networks. 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: ci@service.bytebase.com + BYTEBASE_URL: https://3afb-113-190-242-52.ngrok-free.app + BYTEBASE_SERVICE_ACCOUNT: api-example@service.bytebase.com BYTEBASE_PROJECT: "projects/project-sample" - BYTEBASE_TARGETS: "instances/test-sample-instance/databases/hr_test" + BYTEBASE_TARGETS: "instances/test-sample-instance/databases/hr_test,instances/prod-sample-instance/databases/hr_prod" FILE_PATTERN: "migrations/*.sql" steps: - name: Checkout From fe7e730af292db23ff9f3a96d403b02474861c19 Mon Sep 17 00:00:00 2001 From: huynn0x Date: Tue, 15 Apr 2025 16:04:25 +0700 Subject: [PATCH 3/3] Create main.yml --- .github/workflows/main.yml | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 .github/workflows/main.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..bf6225a --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,25 @@ +# .github/workflows/sql-review.yml +name: SQL Review + +on: + pull_request: + paths: + - 'dev/*.sql' + - 'prod/*.sql' + +jobs: + review-sql: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + - name: Check SQL for DROP statements + run: | + echo "🔍 Checking SQL files..." + if grep -i 'drop' $(find dev/ prod/ -name '*.sql'); then + echo "🚫 DROP statement found!" + exit 1 + else + echo "✅ No DROP statement found." + fi