Skip to content

feat: add user table #9

feat: add user table

feat: add user table #9

name: Check Migration status
on:
pull_request:
branches:
- main
paths:
- "**/*.up.sql"
jobs:
bytebase-check-migration-status:
runs-on: ubuntu-latest
env:
BYTEBASE_URL: "https://bytebase-ci.zeabur.app"
BYTEBASE_SERVICE_ACCOUNT: "[email protected]"
PROJECT: "example"
ISSUE_TITLE: "[${{ github.repository }}#${{ github.event.pull_request.number }}] ${{ github.event.pull_request.title }}"
name: Check Migration Status
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Login to Bytebase
id: login
uses: ./.github/actions/login
with:
url: ${{ env.BYTEBASE_URL }}
service-account: ${{ env.BYTEBASE_SERVICE_ACCOUNT }}
service-account-key: ${{ secrets.BYTEBASE_PASSWORD }}
- name: Get issue
id: get
uses: ./.github/actions/get-issue
with:
url: ${{ env.BYTEBASE_URL }}
token: ${{ steps.login.outputs.token }}
headers: '{"Accept-Encoding": "deflate, gzip"}'
project-id: ${{ env.PROJECT }}
title: ${{ env.ISSUE_TITLE }}
## The example only checks the overall issue status. To make sure the particular migration
## has been rolled out (as opposed to skipped), you may need to check the rollout object.
- name: Check status
id: check
run: |
status=$(echo '${{ steps.get.outputs.issue }}' | jq -r '.status')
issue_uid=$(echo '${{ steps.get.outputs.issue }}' | jq -r '.uid')
issue_url="${{ env.BYTEBASE_URL }}/projects/${{ env.PROJECT }}/issues/${issue_uid}"
if [ "$status" = "DONE" ]; then
echo "Migration has been rolled out: ${issue_url}"
exit 0
else
echo "Migration pending rollout: ${issue_url}"
exit 1
fi