See our tech talk on Databases + CI/CD to see pscale + GitHub Actions
used in a real application.With GitHub Actions, you can automate the creation of branches and deploy requests all within your CI workflow.
Getting Started
Authentication
Convert GitHub branch name to PlanetScale branch name
Create a PlanetScale branch
Recreate the branch when the pull request changes
Create a password for a branch
Open a deploy request
Get deploy request by branch name
Get deploy request diff and comment on pull request
The best way to use PlanetScale within GitHub Actions is via the pscale CLI.Use planetscale/setup-pscale-action to make pscale available within your GitHub Actions.
Authentication for pscale is via service token environment variables.You will need to create a service token. Make sure to give your service token the proper permissions to the database you’ll be using in your workflow.Add your PLANETSCALE_SERVICE_TOKEN_ID and PLANETSCALE_SERVICE_TOKEN to your Actions secrets.In your Actions workflow, you will need to make the secrets available as environment variables.
- name: Run pscale command env: PLANETSCALE_SERVICE_TOKEN_ID: ${{ secrets.PLANETSCALE_SERVICE_TOKEN_ID }} PLANETSCALE_SERVICE_TOKEN: ${{ secrets.PLANETSCALE_SERVICE_TOKEN }} run: pscale database list
The following examples show how to accomplish common Actions workflows with PlanetScale. In each example, notice that we use secrets for the service token, database and organization names.
You will need to set them in your GitHub repository to target your own database.
Convert GitHub branch name to PlanetScale branch name
PlanetScale branch names must be lowercase, alphanumeric characters and hyphens are allowed.Since git branch names allow more possibilities, you can use the following code to transform a git branch name into an acceptable PlanetScale branch name.
This makes ${{ env.PSCALE_BRANCH_NAME }} available for use in the rest of the workflow. This is useful to run in any scenario where you are creating
a PlanetScale branch to correspond with a git branch.
You can use pscale branch create to create a branch that matches your GitHub branch name.
- name: Create branch env: PLANETSCALE_SERVICE_TOKEN_ID: ${{ secrets.PLANETSCALE_SERVICE_TOKEN_ID }} PLANETSCALE_SERVICE_TOKEN: ${{ secrets.PLANETSCALE_SERVICE_TOKEN }} run: | set +e pscale branch show ${{ secrets.PLANETSCALE_DATABASE_NAME }} ${{ env.PSCALE_BRANCH_NAME }} --org ${{ secrets.PLANETSCALE_ORG_NAME }} exit_code=$? set -e if [ $exit_code -eq 0 ]; then echo "Branch exists. Skipping branch creation." else echo "Branch does not exist. Creating." pscale branch create ${{ secrets.PLANETSCALE_DATABASE_NAME }} ${{ env.PSCALE_BRANCH_NAME }} --wait --org ${{ secrets.PLANETSCALE_ORG_NAME }} fi
Notice that we first check if the branch exists. If it does, we do nothing. Otherwise we create it and pass the --wait flag.This is useful when running in CI, as the workflow may run multiple times and you’ll want the branch ready if you are running schema migrations immediately after creating the branch.
Skipping creation when the branch exists reuses whatever schema that branch already has. If a migration in the pull request is edited after the first workflow run, the branch and any open deploy request go stale and no longer match the code under review.Deleting and recreating the branch on every run guarantees it reflects the current pull request. Before deleting, close any open deploy requests for the branch and leave a comment on them pointing back to the pull request.
- name: Recreate branch env: PLANETSCALE_SERVICE_TOKEN_ID: ${{ secrets.PLANETSCALE_SERVICE_TOKEN_ID }} PLANETSCALE_SERVICE_TOKEN: ${{ secrets.PLANETSCALE_SERVICE_TOKEN }} run: | set +e pscale branch show ${{ secrets.PLANETSCALE_DATABASE_NAME }} ${{ env.PSCALE_BRANCH_NAME }} --org ${{ secrets.PLANETSCALE_ORG_NAME }} exists=$? set -e if [ $exists -eq 0 ]; then echo "Branch exists. Closing any open deploy requests and recreating." pr_url="https://github.com/${{ github.repository }}/pull/${{ github.event.pull_request.number }}" stale_numbers=$(pscale deploy-request list ${{ secrets.PLANETSCALE_DATABASE_NAME }} --org ${{ secrets.PLANETSCALE_ORG_NAME }} -f json \ | jq -r --arg branch "${{ env.PSCALE_BRANCH_NAME }}" '.[] | select(.state == "open" and .branch == $branch) | .number') for number in $stale_numbers; do echo "Commenting on and closing deploy request $number" jq -n --arg body "This deploy request is stale. The schema in ${pr_url} changed, so this DR is being closed and a new one will be opened." '{body: $body}' \ | pscale api organizations/${{ secrets.PLANETSCALE_ORG_NAME }}/databases/${{ secrets.PLANETSCALE_DATABASE_NAME }}/deploy-requests/"$number"/comments --org ${{ secrets.PLANETSCALE_ORG_NAME }} --input - \ || echo "Warning: could not comment on deploy request $number" pscale deploy-request close ${{ secrets.PLANETSCALE_DATABASE_NAME }} "$number" --org ${{ secrets.PLANETSCALE_ORG_NAME }} done if [ -n "$stale_numbers" ]; then echo "STALE_DR_NUMBERS=$(echo $stale_numbers | tr '\n' ' ')" >> "$GITHUB_ENV" fi pscale branch delete ${{ secrets.PLANETSCALE_DATABASE_NAME }} ${{ env.PSCALE_BRANCH_NAME }} --org ${{ secrets.PLANETSCALE_ORG_NAME }} --force fi- name: Create branch env: PLANETSCALE_SERVICE_TOKEN_ID: ${{ secrets.PLANETSCALE_SERVICE_TOKEN_ID }} PLANETSCALE_SERVICE_TOKEN: ${{ secrets.PLANETSCALE_SERVICE_TOKEN }} run: pscale branch create ${{ secrets.PLANETSCALE_DATABASE_NAME }} ${{ env.PSCALE_BRANCH_NAME }} --org ${{ secrets.PLANETSCALE_ORG_NAME }} --wait
The numbers of any closed deploy requests are saved to ${{ env.STALE_DR_NUMBERS }}, so a later step can mention which deploy request was replaced when commenting on the pull request.Pair this with a concurrency group keyed on the git branch so two pushes in quick succession don’t delete and create the same PlanetScale branch at the same time.
You can use pscale password create to generate credentials for your database branch.
- name: Generate password for branch env: PLANETSCALE_SERVICE_TOKEN_ID: ${{ secrets.PLANETSCALE_SERVICE_TOKEN_ID }} PLANETSCALE_SERVICE_TOKEN: ${{ secrets.PLANETSCALE_SERVICE_TOKEN }} run: | response=$(pscale password create ${{ secrets.PLANETSCALE_DATABASE_NAME }} ${{ env.PSCALE_BRANCH_NAME }} "" -f json --org ${{ secrets.PLANETSCALE_ORG_NAME }}) id=$(echo "$response" | jq -r '.id') host=$(echo "$response" | jq -r '.access_host_url') username=$(echo "$response" | jq -r '.username') password=$(echo "$response" | jq -r '.plain_text') ssl_mode="verify_identity" # Assuming a default value for ssl_mode ssl_ca="/etc/ssl/certs/ca-certificates.crt" # Assuming a default value for ssl_ca # Set the password ID, allows us to later delete it if wanted. echo "PASSWORD_ID=$id" >> $GITHUB_ENV # Create the DATABASE_URL database_url="mysql://$username:$password@$host/${{ secrets.PLANETSCALE_DATABASE_NAME }}?sslmode=$ssl_mode&sslca=$ssl_ca" echo "DATABASE_URL=$database_url" >> $GITHUB_ENV echo "::add-mask::$DATABASE_URL"- name: Use the DATABASE_URL in a subsequent step run: | echo "Using DATABASE_URL: $DATABASE_URL"
This example shows creating the password and getting back a response in json. The json is then parsed to create a DATABASE_URL which can be used in later steps.
pscale password create can also accept a ttl flag which lets you limit the number of minutes the password is valid for.
You can use pscale deploy-request create to open a new deploy request from GitHub Actions.
This can be useful after running migrations against a branch.
--auto-delete-branch deletes the PlanetScale branch once the deploy request completes, so CI branches don’t accumulate. --notes links the deploy request back to the pull request that created it.
You can use pscale deploy-requests show to grab the latest deploy request by branch name.This can be useful when deploying your application. You can first check if there are any deploy requests open for the branch being deployed. If there are, you can
trigger the deploy request to run before you deploy your application.
Get deploy request diff and comment on pull request
We can use pscale deploy-request diff to see the full schema diff of a deploy request.This example is useful when combined with opening a deploy request for a git branch. You can then automatically comment the diff back to the GitHub pull request.
PlanetScale sets a can_drop_data boolean for any schema change that drop a column or table. We can make use of this to emit a warning into our pull requests.In this example, we first wait for the deployment check to be ready. During this time, PlanetScale is examining the schema change, verifying that it is safe and
generating the DDL statements to make the change. Once it’s done, we then use this information to put a comment on the deploy request with tips on how to deploy it safely.
- name: Check deployment state id: check-state env: PLANETSCALE_SERVICE_TOKEN_ID: ${{ secrets.PLANETSCALE_SERVICE_TOKEN_ID }} PLANETSCALE_SERVICE_TOKEN: ${{ secrets.PLANETSCALE_SERVICE_TOKEN }} run: | for i in {1..10}; do deployment_state=$(pscale deploy-request show ${{ secrets.PLANETSCALE_ORG_NAME }} ${{ env.PSCALE_BRANCH_NAME }} --org ${{ secrets.PLANETSCALE_ORG_NAME }} --format json | jq -r '.deployment_state') echo "Deployment State: $deployment_state" if [ "$deployment_state" = "ready" ]; then echo "Deployment state is ready. Continuing." break fi echo "Deployment state is not ready. Waiting 2 seconds before checking again." sleep 2 done - name: Comment PR - db migrated if: ${{ env.DR_OPENED }} env: PLANETSCALE_SERVICE_TOKEN_ID: ${{ secrets.PLANETSCALE_SERVICE_TOKEN_ID }} PLANETSCALE_SERVICE_TOKEN: ${{ secrets.PLANETSCALE_SERVICE_TOKEN }} run: | deploy_data=$(pscale api organizations/${{ secrets.PLANETSCALE_ORG_NAME }}/databases/${{ secrets.PLANETSCALE_DATABASE_NAME }}/deploy-requests/${{ env.DEPLOY_REQUEST_NUMBER }}/deployment --org planetscale) can_drop_data=$(echo "$deploy_data" | jq -r '.deploy_operations[] | select(.can_drop_data == true) | .can_drop_data') echo "Deploy request opened: https://app.planetscale.com/${{ secrets.PLANETSCALE_ORG_NAME }}/${{ secrets.PLANETSCALE_DATABASE_NAME }}/deploy-requests/${{ env.DEPLOY_REQUEST_NUMBER }}" >> migration-message.txt echo "" >> migration-message.txt if [ "$can_drop_data" = "true" ]; then echo ":rotating_light: You are dropping a column. Before running the migration make sure to do the following:" >> migration-message.txt echo "" >> migration-message.txt echo "1. [ ] Deploy app changes to ensure the column is no longer being used." >> migration-message.txt echo "2. [ ] Once you've verified it's no used, run the deploy request." >> migration-message.txt echo "" >> migration-message.txt else echo "When adding to the schema, the Deploy Request must be run **before** the code is deployed." >> migration-message.txt echo "Please ensure your schema changes are compatible with the application code currently running in production." >> migration-message.txt echo "" >> migration-message.txt echo "1. [ ] Successfully run the Deploy Request" >> migration-message.txt echo "2. [ ] Deploy this PR" >> migration-message.txt echo "" >> migration-message.txt fi echo "\`\`\`diff" >> migration-message.txt pscale deploy-request diff ${{ secrets.PLANETSCALE_ORG_NAME }} ${{ env.DEPLOY_REQUEST_NUMBER }} -f json | jq -r '.[].raw' >> migration-message.txt echo "\`\`\`" >> migration-message.txt - name: Comment PR - db migrated uses: thollander/actions-comment-pull-request@v2 if: ${{ env.DR_OPENED }} with: filePath: migration-message.txt
To trigger a deploy, we can use pscale deploy-request deploy. This command will accept either the deploy request number, or the name of the branch that the deploy request was created from.When using with GitHub Actions, it’s often easier to use the branch name.The --wait flag will let the command run until the deployment is complete. This is important if you want your schema change to run before the next step in your workflow.
{"docsConfig":{"theme":"aspen","$schema":"https://mintlify.com/docs.json","name":"PlanetScale","description":"PlanetScale is a relational database platform for Vitess, Neki, and Postgres that gives you scale, performance, and reliability without sacrificing developer experience.","colors":{"primary":"#0e73cc","light":"#47b7f8","dark":"#f15817"},"logo":{"light":"https://mintcdn.com/planetscale-2/xUilVHToUFALai8a/logo/light.png?fit=max\u0026auto=format\u0026n=xUilVHToUFALai8a\u0026q=85\u0026s=cccd3c9fc813c01b899ab7af15a115b1","dark":"https://mintcdn.com/planetscale-2/xUilVHToUFALai8a/logo/dark.png?fit=max\u0026auto=format\u0026n=xUilVHToUFALai8a\u0026q=85\u0026s=4153888dc0ef54ddc3464738a2d7ee6e","href":"https://planetscale.com"},"favicon":"https://mintcdn.com/planetscale-2/DJh9Bv1aUZHTVDnK/favicon.svg?fit=max\u0026auto=format\u0026n=DJh9Bv1aUZHTVDnK\u0026q=85\u0026s=cc6ec9d8d0deb3450719bb4b5b6df73a","background":{"color":{"light":"#fafafa","dark":"#111111"}},"navbar":{"links":[{"href":"https://auth.planetscale.com/sign-in","label":"Log in"},{"href":"https://auth.planetscale.com/sign-up","label":"Get started"}],"primary":{"type":"button","label":"Get in touch","href":"https://planetscale.com/contact"}},"footer":{"socials":{"x":"https://twitter.com/planetscale","github":"https://github.com/planetscale","linkedin":"https://www.linkedin.com/company/planetscale","youtube":"https://www.youtube.com/c/PlanetScale","discord":"https://pscale.link/community","facebook":"https://www.facebook.com/planetscaledata"}},"seo":{"metatags":{"canonical":"https://planetscale.com/docs"}},"fonts":{"heading":{"family":"Inter"},"body":{"family":"Inter"}},"integrations":{"segment":{"key":"9Ujczlrndco2w8fcFAakL0FT4bsJCCh3"}},"contextual":{"options":["copy","view","chatgpt","claude","perplexity","mcp","cursor","vscode"],"display":"header"},"styling":{"latex":false},"navigation":{"global":{"anchors":[{"anchor":"Blog","icon":"newspaper","href":"https://planetscale.com/blog"},{"anchor":"Contact Us","icon":"headset","href":"https://planetscale.com/contact"},{"anchor":"Status","icon":"signal","href":"https://www.planetscalestatus.com/"},{"anchor":"Benchmarks","icon":"chart-line","href":"https://planetscale.com/benchmarks"}]},"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"planetscale-2","hasAudioNarration":false,"actualSubdomain":"planetscale-2","customDomains":["planetscale.com"],"gitSource":{"type":"github","owner":"planetscale","repo":"www","deployBranch":"main","contentDirectory":"content/mintlify/docs","isPrivate":true,"mountPath":"","label":""},"chroma":{"liveDeploymentHistoryId":"6ae10d37cc5d3160cbaf221b","collectionId":"2cd10892-448e-47b4-995d-6618136112cb","schemaVersion":"v3","latestBuiltDeploymentHistoryId":"6ae10d37cc5d3160cbaf221b"},"entitlements":{"AI_CHAT":{"status":"ENABLED"},"CONTEXTUAL_FEEDBACK":{"status":"ENABLED"},"CODE_SNIPPET_FEEDBACK":{"status":"ENABLED"},"WEB_MCP":{"status":"ENABLED"},"NARRATION":{"status":"ENABLED"}},"buildId":"6ae10d37cc5d3160cbaf221b","clientVersion":"0.0.4006","searchFilterCounts":[{"language":"default","tag":"Platform","count":286},{"language":"default","tag":"API Reference","count":262},{"language":"default","tag":"Vitess","count":182},{"language":"default","tag":"Postgres","count":108},{"language":"default","tag":"General API endpoints","count":93},{"language":"default","tag":"Vitess API endpoints","count":59},{"language":"default","tag":"Neki","count":58},{"language":"default","tag":"Guides","count":58},{"language":"default","tag":"Neki API endpoints","count":50},{"language":"default","tag":"Postgres API endpoints","count":46}]},"assistantConfig":{"enableAskAiButton":false,"enableStarterQuestions":false,"enableAskAiSearchBar":true,"deflection":{"enabled":true,"type":"link","url":"https://planetscale.com/contact?initial=support"}},"basePath":"/docs","hasChatPermissions":true,"hasWebMcpPermissions":true,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-v7-file-tree","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-onboarding","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"pause-universal-search-reconcile","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"per-site-search-delta","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-private-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-nav-generations","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"assistant-v5","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"byok-sep-25","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"vite-origin","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-agent-model-picker","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-updated-9-15","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-sso-scim","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-signup","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-enabled","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"googleFontsInlined":false},"customCss":[{"filePath":"style.css","content":"#content-container{column-gap:2rem}.nav-tabs{column-gap:.5em}.nav-tabs-item{padding:0 8px}.eyebrow,.light #navigation-items .text-gray-700,.nav-tabs a{color:#616161}#navigation-items .text-primary,#topbar-cta-button .text-white,#topbar-cta-button svg,.nav-tabs a.text-primary{color:#1a1a1a}.nav-tabs a.text-primary .bg-primary{background-color:#1a1a1a;left:0}.dark .nav-tabs a[href='/docs/vitess'i].text-primary,.nav-tabs a[href='/docs/vitess'i].text-primary{color:#f15817}.dark .nav-tabs a[href='/docs/vitess'i].text-primary .bg-primary,.nav-tabs a[href='/docs/vitess'i].text-primary .bg-primary{background-color:#f15817}.nav-tabs a[href='/docs/postgres'i].text-primary{color:#0e73cc}.nav-tabs a[href='/docs/postgres'i].text-primary .bg-primary{background-color:#0e73cc}.nav-tabs a[href='/docs/neki'i].text-primary{color:#8f7200}.nav-tabs a[href='/docs/neki'i].text-primary .bg-primary{background-color:#8f7200}.dark .nav-tabs a{color:#a1a1a1}.dark #navigation-items .text-primary,.dark .nav-tabs a.text-primary{color:#fafafa}.dark .nav-tabs a.text-primary .bg-primary{background-color:#fafafa}.dark .nav-tabs a[href='/docs/postgres'i].text-primary{color:#47b7f8}.dark .nav-tabs a[href='/docs/postgres'i].text-primary .bg-primary{background-color:#47b7f8}.dark .nav-tabs a[href='/docs/neki'i].text-primary{color:#fbca00}.dark .nav-tabs a[href='/docs/neki'i].text-primary .bg-primary{background-color:#fbca00}.prose:is(.dark *){color:#c1c1c1}.prose :where(a):not(:where([class~='not-prose'], [class~='not-prose'] *)){color:#0e73cc;font-weight:500}.dark .prose :where(a):not(:where(.not-prose, .not-prose *)){color:#47b7f8}.dark .eyebrow{color:#a1a1a1}@media (min-width:1024px){#content-container{padding-top:2rem;padding-right:2rem;padding-left:2.5rem}}#topbar-cta-button a>span{background-color:#fbca00}.group:hover span{opacity:1!important}.bg-primary\\/10{background-color:rgba(129,129,129,.1)}.dark .bg-primary\\/10{background-color:rgba(255,255,255,.1)}body[data-current-path^='/vitess'] svg.bg-primary{background-color:#f15817}body[data-current-path^='/vitess'] .border-primary{border-color:#f15817}body[data-current-path^='/vitess'] #table-of-contents-content .text-primary,body[data-current-path^='/vitess'] .eyebrow{color:#f15817}body[data-current-path^='/vitess'] .card-group a:hover{border-color:#f15817!important}body[data-current-path^='/postgres'] .eyebrow{color:#0e73cc}.dark body[data-current-path^='/postgres'] .eyebrow{color:#47b7f8}body[data-current-path^='/neki'] svg.bg-primary{background-color:#8f7200}body[data-current-path^='/neki'] [data-component-part=card-icon]{background-color:#fbca00}body[data-current-path^='/neki'] [data-component-part=card-icon] svg.bg-primary{background-color:#1a1a1a;transform:scale(.7);transform-origin:center}body[data-current-path^='/neki'] .border-primary{border-color:#8f7200}body[data-current-path^='/neki'] #table-of-contents-content .text-primary{color:#1a1a1a;background-color:transparent;border-color:#fbca00}body[data-current-path^='/neki'] .eyebrow{display:inline-flex;align-items:center;width:fit-content;height:auto;min-height:1.25rem;padding:0 .375rem;color:#1a1a1a;background-color:#fbca00}body[data-current-path^='/neki'] .eyebrow:empty,body[data-current-path^='/neki'] .eyebrow[data-empty]{display:none}.dark body[data-current-path^='/neki'] .card-group .card:hover,body[data-current-path^='/neki'] .card-group .card:hover{--primary:251 202 0;--primary-light:251 202 0;border-color:#fbca00!important}.dark body[data-current-path^='/neki'] [data-component-part=card-icon],.dark body[data-current-path^='/neki'] svg.bg-primary{background-color:#fbca00}.dark body[data-current-path^='/neki'] [data-component-part=card-icon] svg.bg-primary{background-color:#1a1a1a}.dark body[data-current-path^='/neki'] .border-primary{border-color:#fbca00}.dark body[data-current-path^='/neki'] #table-of-contents-content .text-primary{color:#fafafa;background-color:transparent;border-color:#fbca00}.dark body[data-current-path^='/neki'] .eyebrow{color:#1a1a1a;background-color:#fbca00}footer div:last-child{display:none}#header,#pagination a,[data-component-part=card-content-container],[data-component-part=frame-caption]{text-wrap:balance}.step:last-of-type [data-component-part=step-line]{opacity:0}"}],"page":{"pagePath":"vitess/integrations/github-actions","slug":"/vitess/integrations/github-actions","pageMetadata":{"title":"PlanetScale GitHub Actions","sidebarTitle":"Automating with GitHub Actions","og:image":"images/og/vitess/integrations/github-actions.png","description":null,"href":"/vitess/integrations/github-actions"},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];const __snippet_platformLabels_3vlljw={vitess:`Vitess`,postgres:`Postgres`,neki:`Neki`};const __snippet_combinedPlatformLabels_3vlljw={both:`Vitess and Postgres`,all:`Vitess, Neki, and Postgres`,\"postgres-neki\":`Postgres and Neki`};const __snippet_platformBadgeClassName_3vlljw=`inline-flex items-center gap-1.5 whitespace-nowrap rounded-full border px-2.5 py-1 text-[13px] font-semibold leading-tight no-underline data-[engine=vitess]:data-[state=current]:border-[#ffc59b] data-[engine=vitess]:data-[state=current]:bg-[#ffe8d8] data-[engine=vitess]:data-[state=current]:text-[#672002] dark:data-[engine=vitess]:data-[state=current]:border-[#962d00] dark:data-[engine=vitess]:data-[state=current]:bg-[#3c1403] dark:data-[engine=vitess]:data-[state=current]:text-[#ffe8d8] data-[engine=vitess]:data-[state=link]:border-[#ffc59b] data-[engine=vitess]:data-[state=link]:bg-transparent data-[engine=vitess]:data-[state=link]:text-[#b83a05] dark:data-[engine=vitess]:data-[state=link]:border-[#962d00] dark:data-[engine=vitess]:data-[state=link]:bg-transparent dark:data-[engine=vitess]:data-[state=link]:text-[#ffc59b] data-[engine=postgres]:data-[state=current]:border-[#a9dffe] data-[engine=postgres]:data-[state=current]:bg-[#ddf2ff] data-[engine=postgres]:data-[state=current]:text-[#0e3682] dark:data-[engine=postgres]:data-[state=current]:border-[#144eb6] dark:data-[engine=postgres]:data-[state=current]:bg-[#08204e] dark:data-[engine=postgres]:data-[state=current]:text-[#ddf2ff] data-[engine=postgres]:data-[state=link]:border-[#a9dffe] data-[engine=postgres]:data-[state=link]:bg-transparent data-[engine=postgres]:data-[state=link]:text-[#0b6ec5] dark:data-[engine=postgres]:data-[state=link]:border-[#144eb6] dark:data-[engine=postgres]:data-[state=link]:bg-transparent dark:data-[engine=postgres]:data-[state=link]:text-[#73c7f9] data-[engine=neki]:data-[state=current]:border-[#fbca00] data-[engine=neki]:data-[state=current]:bg-[#fbca00] data-[engine=neki]:data-[state=current]:text-[#1a1a1a] dark:data-[engine=neki]:data-[state=current]:border-[#fbca00] dark:data-[engine=neki]:data-[state=current]:bg-[#fbca00] dark:data-[engine=neki]:data-[state=current]:text-[#1a1a1a] data-[engine=neki]:data-[state=link]:border-[#fbca00] data-[engine=neki]:data-[state=link]:bg-transparent data-[engine=neki]:data-[state=link]:text-[#8f7200] dark:data-[engine=neki]:data-[state=link]:border-[#fbca00] dark:data-[engine=neki]:data-[state=link]:bg-transparent dark:data-[engine=neki]:data-[state=link]:text-[#fbca00] data-[engine=both]:data-[state=current]:border-[#d4d4d4] data-[engine=both]:data-[state=current]:bg-[#f0f0f0] data-[engine=both]:data-[state=current]:text-[#3d3d3d] dark:data-[engine=both]:data-[state=current]:border-[#525252] dark:data-[engine=both]:data-[state=current]:bg-[#2a2a2a] dark:data-[engine=both]:data-[state=current]:text-[#e5e5e5]`;const __snippet_docsHref_3vlljw=path=>path.startsWith(`/`)?path:`/${path}`;const __snippet_PlatformAvailabilityBadges_3vlljw=({current,vitess,postgres,neki})=>{const _components={a:`a`,..._provideComponents()};if(__snippet_combinedPlatformLabels_3vlljw[current]){return _jsx(`div`,{className:`not-prose mint-mb-5 mint-flex mint-flex-wrap mint-items-center mint-gap-2`,role:`group`,\"aria-label\":`Platform availability`,children:_jsx(`span`,{\"data-engine\":`both`,\"data-state\":`current`,\"aria-current\":`true`,className:`mint-inline-flex mint-items-center mint-gap-1.5 mint-whitespace-nowrap mint-rounded-full mint-border mint-px-2.5 mint-py-1 mint-text-[13px] mint-font-semibold mint-leading-tight mint-no-underline data-[engine=vitess]:data-[state=current]:mint-border-[#ffc59b] data-[engine=vitess]:data-[state=current]:mint-bg-[#ffe8d8] data-[engine=vitess]:data-[state=current]:mint-text-[#672002] dark:data-[engine=vitess]:data-[state=current]:mint-border-[#962d00] dark:data-[engine=vitess]:data-[state=current]:mint-bg-[#3c1403] dark:data-[engine=vitess]:data-[state=current]:mint-text-[#ffe8d8] data-[engine=vitess]:data-[state=link]:mint-border-[#ffc59b] data-[engine=vitess]:data-[state=link]:mint-bg-transparent data-[engine=vitess]:data-[state=link]:mint-text-[#b83a05] dark:data-[engine=vitess]:data-[state=link]:mint-border-[#962d00] dark:data-[engine=vitess]:data-[state=link]:mint-bg-transparent dark:data-[engine=vitess]:data-[state=link]:mint-text-[#ffc59b] data-[engine=postgres]:data-[state=current]:mint-border-[#a9dffe] data-[engine=postgres]:data-[state=current]:mint-bg-[#ddf2ff] data-[engine=postgres]:data-[state=current]:mint-text-[#0e3682] dark:data-[engine=postgres]:data-[state=current]:mint-border-[#144eb6] dark:data-[engine=postgres]:data-[state=current]:mint-bg-[#08204e] dark:data-[engine=postgres]:data-[state=current]:mint-text-[#ddf2ff] data-[engine=postgres]:data-[state=link]:mint-border-[#a9dffe] data-[engine=postgres]:data-[state=link]:mint-bg-transparent data-[engine=postgres]:data-[state=link]:mint-text-[#0b6ec5] dark:data-[engine=postgres]:data-[state=link]:mint-border-[#144eb6] dark:data-[engine=postgres]:data-[state=link]:mint-bg-transparent dark:data-[engine=postgres]:data-[state=link]:mint-text-[#73c7f9] data-[engine=neki]:data-[state=current]:mint-border-[#fbca00] data-[engine=neki]:data-[state=current]:mint-bg-[#fbca00] data-[engine=neki]:data-[state=current]:mint-text-[#1a1a1a] dark:data-[engine=neki]:data-[state=current]:mint-border-[#fbca00] dark:data-[engine=neki]:data-[state=current]:mint-bg-[#fbca00] dark:data-[engine=neki]:data-[state=current]:mint-text-[#1a1a1a] data-[engine=neki]:data-[state=link]:mint-border-[#fbca00] data-[engine=neki]:data-[state=link]:mint-bg-transparent data-[engine=neki]:data-[state=link]:mint-text-[#8f7200] dark:data-[engine=neki]:data-[state=link]:mint-border-[#fbca00] dark:data-[engine=neki]:data-[state=link]:mint-bg-transparent dark:data-[engine=neki]:data-[state=link]:mint-text-[#fbca00] data-[engine=both]:data-[state=current]:mint-border-[#d4d4d4] data-[engine=both]:data-[state=current]:mint-bg-[#f0f0f0] data-[engine=both]:data-[state=current]:mint-text-[#3d3d3d] dark:data-[engine=both]:data-[state=current]:mint-border-[#525252] dark:data-[engine=both]:data-[state=current]:mint-bg-[#2a2a2a] dark:data-[engine=both]:data-[state=current]:mint-text-[#e5e5e5]`,children:__snippet_combinedPlatformLabels_3vlljw[current]})})}const paths={vitess,postgres,neki};const others=[`vitess`,`neki`,`postgres`].filter(engine=>engine!==current\u0026\u0026paths[engine]);const engines=__snippet_platformLabels_3vlljw[current]?[current,...others]:others;const only=engines.length===1;return _jsx(`div`,{className:`not-prose mint-mb-5 mint-flex mint-flex-wrap mint-items-center mint-gap-2`,role:`group`,\"aria-label\":`Platform availability`,children:engines.map(engine=>{const label=only?`${__snippet_platformLabels_3vlljw[engine]} only`:__snippet_platformLabels_3vlljw[engine];if(engine===current){return _jsx(`span`,{\"data-engine\":engine,\"data-state\":`current`,\"aria-current\":`true`,className:`mint-inline-flex mint-items-center mint-gap-1.5 mint-whitespace-nowrap mint-rounded-full mint-border mint-px-2.5 mint-py-1 mint-text-[13px] mint-font-semibold mint-leading-tight mint-no-underline data-[engine=vitess]:data-[state=current]:mint-border-[#ffc59b] data-[engine=vitess]:data-[state=current]:mint-bg-[#ffe8d8] data-[engine=vitess]:data-[state=current]:mint-text-[#672002] dark:data-[engine=vitess]:data-[state=current]:mint-border-[#962d00] dark:data-[engine=vitess]:data-[state=current]:mint-bg-[#3c1403] dark:data-[engine=vitess]:data-[state=current]:mint-text-[#ffe8d8] data-[engine=vitess]:data-[state=link]:mint-border-[#ffc59b] data-[engine=vitess]:data-[state=link]:mint-bg-transparent data-[engine=vitess]:data-[state=link]:mint-text-[#b83a05] dark:data-[engine=vitess]:data-[state=link]:mint-border-[#962d00] dark:data-[engine=vitess]:data-[state=link]:mint-bg-transparent dark:data-[engine=vitess]:data-[state=link]:mint-text-[#ffc59b] data-[engine=postgres]:data-[state=current]:mint-border-[#a9dffe] data-[engine=postgres]:data-[state=current]:mint-bg-[#ddf2ff] data-[engine=postgres]:data-[state=current]:mint-text-[#0e3682] dark:data-[engine=postgres]:data-[state=current]:mint-border-[#144eb6] dark:data-[engine=postgres]:data-[state=current]:mint-bg-[#08204e] dark:data-[engine=postgres]:data-[state=current]:mint-text-[#ddf2ff] data-[engine=postgres]:data-[state=link]:mint-border-[#a9dffe] data-[engine=postgres]:data-[state=link]:mint-bg-transparent data-[engine=postgres]:data-[state=link]:mint-text-[#0b6ec5] dark:data-[engine=postgres]:data-[state=link]:mint-border-[#144eb6] dark:data-[engine=postgres]:data-[state=link]:mint-bg-transparent dark:data-[engine=postgres]:data-[state=link]:mint-text-[#73c7f9] data-[engine=neki]:data-[state=current]:mint-border-[#fbca00] data-[engine=neki]:data-[state=current]:mint-bg-[#fbca00] data-[engine=neki]:data-[state=current]:mint-text-[#1a1a1a] dark:data-[engine=neki]:data-[state=current]:mint-border-[#fbca00] dark:data-[engine=neki]:data-[state=current]:mint-bg-[#fbca00] dark:data-[engine=neki]:data-[state=current]:mint-text-[#1a1a1a] data-[engine=neki]:data-[state=link]:mint-border-[#fbca00] data-[engine=neki]:data-[state=link]:mint-bg-transparent data-[engine=neki]:data-[state=link]:mint-text-[#8f7200] dark:data-[engine=neki]:data-[state=link]:mint-border-[#fbca00] dark:data-[engine=neki]:data-[state=link]:mint-bg-transparent dark:data-[engine=neki]:data-[state=link]:mint-text-[#fbca00] data-[engine=both]:data-[state=current]:mint-border-[#d4d4d4] data-[engine=both]:data-[state=current]:mint-bg-[#f0f0f0] data-[engine=both]:data-[state=current]:mint-text-[#3d3d3d] dark:data-[engine=both]:data-[state=current]:mint-border-[#525252] dark:data-[engine=both]:data-[state=current]:mint-bg-[#2a2a2a] dark:data-[engine=both]:data-[state=current]:mint-text-[#e5e5e5]`,children:label},engine)}return _jsxs(_components.a,{href:__snippet_docsHref_3vlljw(paths[engine]),\"data-engine\":engine,\"data-state\":`link`,title:`View ${__snippet_platformLabels_3vlljw[engine]} documentation`,className:`mint-inline-flex mint-items-center mint-gap-1.5 mint-whitespace-nowrap mint-rounded-full mint-border mint-px-2.5 mint-py-1 mint-text-[13px] mint-font-semibold mint-leading-tight mint-no-underline data-[engine=vitess]:data-[state=current]:mint-border-[#ffc59b] data-[engine=vitess]:data-[state=current]:mint-bg-[#ffe8d8] data-[engine=vitess]:data-[state=current]:mint-text-[#672002] dark:data-[engine=vitess]:data-[state=current]:mint-border-[#962d00] dark:data-[engine=vitess]:data-[state=current]:mint-bg-[#3c1403] dark:data-[engine=vitess]:data-[state=current]:mint-text-[#ffe8d8] data-[engine=vitess]:data-[state=link]:mint-border-[#ffc59b] data-[engine=vitess]:data-[state=link]:mint-bg-transparent data-[engine=vitess]:data-[state=link]:mint-text-[#b83a05] dark:data-[engine=vitess]:data-[state=link]:mint-border-[#962d00] dark:data-[engine=vitess]:data-[state=link]:mint-bg-transparent dark:data-[engine=vitess]:data-[state=link]:mint-text-[#ffc59b] data-[engine=postgres]:data-[state=current]:mint-border-[#a9dffe] data-[engine=postgres]:data-[state=current]:mint-bg-[#ddf2ff] data-[engine=postgres]:data-[state=current]:mint-text-[#0e3682] dark:data-[engine=postgres]:data-[state=current]:mint-border-[#144eb6] dark:data-[engine=postgres]:data-[state=current]:mint-bg-[#08204e] dark:data-[engine=postgres]:data-[state=current]:mint-text-[#ddf2ff] data-[engine=postgres]:data-[state=link]:mint-border-[#a9dffe] data-[engine=postgres]:data-[state=link]:mint-bg-transparent data-[engine=postgres]:data-[state=link]:mint-text-[#0b6ec5] dark:data-[engine=postgres]:data-[state=link]:mint-border-[#144eb6] dark:data-[engine=postgres]:data-[state=link]:mint-bg-transparent dark:data-[engine=postgres]:data-[state=link]:mint-text-[#73c7f9] data-[engine=neki]:data-[state=current]:mint-border-[#fbca00] data-[engine=neki]:data-[state=current]:mint-bg-[#fbca00] data-[engine=neki]:data-[state=current]:mint-text-[#1a1a1a] dark:data-[engine=neki]:data-[state=current]:mint-border-[#fbca00] dark:data-[engine=neki]:data-[state=current]:mint-bg-[#fbca00] dark:data-[engine=neki]:data-[state=current]:mint-text-[#1a1a1a] data-[engine=neki]:data-[state=link]:mint-border-[#fbca00] data-[engine=neki]:data-[state=link]:mint-bg-transparent data-[engine=neki]:data-[state=link]:mint-text-[#8f7200] dark:data-[engine=neki]:data-[state=link]:mint-border-[#fbca00] dark:data-[engine=neki]:data-[state=link]:mint-bg-transparent dark:data-[engine=neki]:data-[state=link]:mint-text-[#fbca00] data-[engine=both]:data-[state=current]:mint-border-[#d4d4d4] data-[engine=both]:data-[state=current]:mint-bg-[#f0f0f0] data-[engine=both]:data-[state=current]:mint-text-[#3d3d3d] dark:data-[engine=both]:data-[state=current]:mint-border-[#525252] dark:data-[engine=both]:data-[state=current]:mint-bg-[#2a2a2a] dark:data-[engine=both]:data-[state=current]:mint-text-[#e5e5e5]`,children:[label,_jsx(`svg`,{\"aria-hidden\":`true`,width:`12`,height:`12`,viewBox:`0 0 12 12`,fill:`none`,className:`mint-shrink-0`,children:_jsx(`path`,{d:`M2.5 6h7M6.5 3l3 3-3 3`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`})})]},engine)})})};const __snippet_PlatformAvailabilityText_3vlljw=({current,vitess,postgres,neki})=>{const _components={a:`a`,..._provideComponents()};return __snippet_combinedPlatformLabels_3vlljw[current]?_jsxs(`p`,{children:[`Available for `,__snippet_combinedPlatformLabels_3vlljw[current],`.`]}):_jsxs(_Fragment,{children:[_jsxs(`p`,{children:[`This page covers `,__snippet_platformLabels_3vlljw[current],`.`]}),vitess\u0026\u0026current!==`vitess`?_jsxs(`p`,{children:[`Vitess version: `,_jsx(_components.a,{href:vitess.startsWith(`/`)?vitess:`/`+vitess,children:__snippet_platformLabels_3vlljw.vitess})]}):null,postgres\u0026\u0026current!==`postgres`?_jsxs(`p`,{children:[`Postgres version: `,_jsx(_components.a,{href:postgres.startsWith(`/`)?postgres:`/`+postgres,children:__snippet_platformLabels_3vlljw.postgres})]}):null,neki\u0026\u0026current!==`neki`?_jsxs(`p`,{children:[`Neki version: `,_jsx(_components.a,{href:neki.startsWith(`/`)?neki:`/`+neki,children:__snippet_platformLabels_3vlljw.neki})]}):null]})};const PlatformAvailability=props=>{const{Visibility}=_provideComponents()||{};if(!Visibility)_missingMdxReference(`Visibility`,true);return _jsxs(_Fragment,{children:[_jsx(Visibility,{for:`humans`,children:_jsx(__snippet_PlatformAvailabilityBadges_3vlljw,{...props})}),_jsx(Visibility,{for:`agents`,children:_jsx(__snippet_PlatformAvailabilityText_3vlljw,{...props})})]})};function _createMdxContent(props){const _components={a:`a`,code:`code`,p:`p`,pre:`pre`,span:`span`,..._provideComponents(),...props.components},{Card,CodeBlock,Columns,Heading,Note,_MdxComponentBoundary}=_components;if(!Card)_missingMdxReference(`Card`,true);if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Columns)_missingMdxReference(`Columns`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Note)_missingMdxReference(`Note`,true);if(!_MdxComponentBoundary)_missingMdxReference(`_MdxComponentBoundary`,true);return _jsxs(_Fragment,{children:[_jsx(_MdxComponentBoundary,{name:`PlatformAvailability`,children:_jsx(PlatformAvailability,{current:`vitess`,postgres:`/postgres/integrations/github-actions`})}),`\n`,_jsxs(_components.p,{children:[`See our `,_jsx(_components.a,{href:`https://planetscale.com/blog/databases-ci-cd-pipeline`,children:`tech talk on Databases + CI/CD`}),` to see pscale + GitHub Actions\nused in a real application.`]}),`\n`,_jsx(_components.p,{children:`With GitHub Actions, you can automate the creation of branches and deploy requests all within your CI workflow.`}),`\n`,_jsxs(Columns,{cols:2,children:[_jsx(Card,{title:`Getting Started`,href:`#getting-started`,icon:`rocket-launch`,horizontal:true}),_jsx(Card,{title:`Authentication`,href:`#authentication`,icon:`key`,horizontal:true}),_jsx(Card,{title:`Convert GitHub branch name to PlanetScale branch name`,href:`#convert-github-branch-name-to-planetscale-branch-name`,icon:`code-branch`,horizontal:true}),_jsx(Card,{title:`Create a PlanetScale branch`,href:`#create-a-planetscale-branch`,icon:`code-branch`,horizontal:true}),_jsx(Card,{title:`Recreate the branch when the pull request changes`,href:`#recreate-the-branch-when-the-pull-request-changes`,icon:`code-branch`,horizontal:true}),_jsx(Card,{title:`Create a password for a branch`,href:`#create-a-password-for-a-branch`,icon:`key`,horizontal:true}),_jsx(Card,{title:`Open a deploy request`,href:`#open-a-deploy-request`,icon:`code-branch`,horizontal:true}),_jsx(Card,{title:`Get deploy request by branch name`,href:`#get-deploy-request-by-branch-name`,icon:`code-branch`,horizontal:true}),_jsx(Card,{title:`Get deploy request diff and comment on pull request`,href:`#get-deploy-request-diff-and-comment-on-pull-request`,icon:`code-branch`,horizontal:true}),_jsx(Card,{title:`Check for dropped columns`,href:`#check-for-dropped-columns`,icon:`code-branch`,horizontal:true}),_jsx(Card,{title:`Submit a deploy request by branch name`,href:`#submit-a-deploy-request-by-branch-name`,icon:`code-branch`,horizontal:true})]}),`\n`,_jsx(Heading,{level:`2`,id:`getting-started`,children:`Getting started`}),`\n`,_jsxs(_components.p,{children:[`The best way to use PlanetScale within GitHub Actions is via the `,_jsx(_components.code,{children:`pscale`}),` CLI.`]}),`\n`,_jsxs(_components.p,{children:[`Use `,_jsx(_components.a,{href:`https://github.com/planetscale/setup-pscale-action`,children:_jsx(_components.code,{children:`planetscale/setup-pscale-action`})}),` to make pscale available within your GitHub Actions.`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`2`,language:`yaml`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`yaml`,children:_jsxs(_components.code,{language:`yaml`,numberOfLines:`2`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`- `}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:`name`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`Setup pscale`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` uses`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`planetscale/setup-pscale-action@v1`})]}),`\n`]})})}),`\n`,_jsx(_components.p,{children:`The action works with Linux, Windows, and Mac runners. Once installed it will be added to your tool cache for subsequent runs.`}),`\n`,_jsx(Heading,{level:`2`,id:`authentication`,children:`Authentication`}),`\n`,_jsx(_components.p,{children:`Authentication for pscale is via service token environment variables.`}),`\n`,_jsxs(_components.p,{children:[`You will need to `,_jsx(_components.a,{href:`/cli/service-token`,children:`create a service token`}),`. Make sure to give your service token the proper permissions to the database you’ll be using in your workflow.`]}),`\n`,_jsxs(_components.p,{children:[`Add your `,_jsx(_components.code,{children:`PLANETSCALE_SERVICE_TOKEN_ID`}),` and `,_jsx(_components.code,{children:`PLANETSCALE_SERVICE_TOKEN`}),` to your `,_jsx(_components.a,{href:`https://docs.github.com/en/actions/security-guides/using-secrets-in-github-actions#creating-secrets-for-a-repository`,children:`Actions secrets`}),`.`]}),`\n`,_jsx(_components.p,{children:`In your Actions workflow, you will need to make the secrets available as environment variables.`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`5`,language:`yaml`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`yaml`,children:_jsxs(_components.code,{language:`yaml`,numberOfLines:`5`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`- `}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:`name`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`Run pscale command`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` env`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` PLANETSCALE_SERVICE_TOKEN_ID`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:\"${{ secrets.PLANETSCALE_SERVICE_TOKEN_ID }}\"})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` PLANETSCALE_SERVICE_TOKEN`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:\"${{ secrets.PLANETSCALE_SERVICE_TOKEN }}\"})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` run`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`pscale database list`})]}),`\n`]})})}),`\n`,_jsx(Heading,{level:`2`,id:`examples`,children:`Examples`}),`\n`,_jsx(_components.p,{children:`The following examples show how to accomplish common Actions workflows with PlanetScale. In each example, notice that we use secrets for the service token, database and organization names.\nYou will need to set them in your GitHub repository to target your own database.`}),`\n`,_jsx(CodeBlock,{numberOfLines:`5`,language:`text`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`text`,children:_jsxs(_components.code,{language:`text`,numberOfLines:`5`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`PLANETSCALE_ORG_NAME`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`PLANETSCALE_DATABASE_NAME`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`PLANETSCALE_SERVICE_TOKEN_ID`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`PLANETSCALE_SERVICE_TOKEN`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})}),`\n`,_jsx(Heading,{level:`3`,id:`convert-github-branch-name-to-planetscale-branch-name`,children:`Convert GitHub branch name to PlanetScale branch name`}),`\n`,_jsx(_components.p,{children:`PlanetScale branch names must be lowercase, alphanumeric characters and hyphens are allowed.`}),`\n`,_jsx(_components.p,{children:`Since git branch names allow more possibilities, you can use the following code to transform a git branch name into an acceptable PlanetScale branch name.`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`6`,language:`yaml`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`yaml`,children:_jsxs(_components.code,{language:`yaml`,numberOfLines:`6`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`- `}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:`name`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`Rename branch name`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` run`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`|`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` branch_name=$(printf '%s' \"$HEAD_REF\" | tr -cd '[:alnum:]-' | tr '[:upper:]' '[:lower:]')`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` echo \"PSCALE_BRANCH_NAME=$branch_name\" >> \"$GITHUB_ENV\"`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` env`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` HEAD_REF`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:\"${{ github.head_ref }}\"})]}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`This makes `,_jsx(_components.code,{children:\"${{ env.PSCALE_BRANCH_NAME }}\"}),` available for use in the rest of the workflow. This is useful to run in any scenario where you are creating\na PlanetScale branch to correspond with a git branch.`]}),`\n`,_jsx(Heading,{level:`3`,id:`create-a-planetscale-branch`,children:`Create a PlanetScale branch`}),`\n`,_jsxs(_components.p,{children:[`You can use `,_jsx(_components.code,{children:`pscale branch create`}),` to create a branch that matches your GitHub branch name.`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`16`,language:`yaml`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`yaml`,children:_jsxs(_components.code,{language:`yaml`,numberOfLines:`16`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`- `}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:`name`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`Create branch`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` env`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` PLANETSCALE_SERVICE_TOKEN_ID`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:\"${{ secrets.PLANETSCALE_SERVICE_TOKEN_ID }}\"})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` PLANETSCALE_SERVICE_TOKEN`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:\"${{ secrets.PLANETSCALE_SERVICE_TOKEN }}\"})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` run`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`|`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` set +e`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:\" pscale branch show ${{ secrets.PLANETSCALE_DATABASE_NAME }} ${{ env.PSCALE_BRANCH_NAME }} --org ${{ secrets.PLANETSCALE_ORG_NAME }}\"})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` exit_code=$?`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` set -e`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` if [ $exit_code -eq 0 ]; then`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` echo \"Branch exists. Skipping branch creation.\"`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` else`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` echo \"Branch does not exist. Creating.\"`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:\" pscale branch create ${{ secrets.PLANETSCALE_DATABASE_NAME }} ${{ env.PSCALE_BRANCH_NAME }} --wait --org ${{ secrets.PLANETSCALE_ORG_NAME }}\"})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` fi`})}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`Notice that we first check if the branch exists. If it does, we do nothing. Otherwise we create it and pass the `,_jsx(_components.code,{children:`--wait`}),` flag.`]}),`\n`,_jsx(_components.p,{children:`This is useful when running in CI, as the workflow may run multiple times and you’ll want the branch ready if you are running schema migrations immediately after creating the branch.`}),`\n`,_jsx(Heading,{level:`3`,id:`recreate-the-branch-when-the-pull-request-changes`,children:`Recreate the branch when the pull request changes`}),`\n`,_jsx(_components.p,{children:`Skipping creation when the branch exists reuses whatever schema that branch already has. If a migration in the pull request is edited after the first workflow run, the branch and any open deploy request go stale and no longer match the code under review.`}),`\n`,_jsx(_components.p,{children:`Deleting and recreating the branch on every run guarantees it reflects the current pull request. Before deleting, close any open deploy requests for the branch and leave a comment on them pointing back to the pull request.`}),`\n`,_jsx(CodeBlock,{filename:``,expandable:`true`,numberOfLines:`35`,language:`yaml`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`yaml`,children:_jsxs(_components.code,{language:`yaml`,numberOfLines:`35`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`- `}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:`name`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`Recreate branch`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` env`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` PLANETSCALE_SERVICE_TOKEN_ID`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:\"${{ secrets.PLANETSCALE_SERVICE_TOKEN_ID }}\"})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` PLANETSCALE_SERVICE_TOKEN`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:\"${{ secrets.PLANETSCALE_SERVICE_TOKEN }}\"})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` run`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`|`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` set +e`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:\" pscale branch show ${{ secrets.PLANETSCALE_DATABASE_NAME }} ${{ env.PSCALE_BRANCH_NAME }} --org ${{ secrets.PLANETSCALE_ORG_NAME }}\"})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` exists=$?`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` set -e`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` if [ $exists -eq 0 ]; then`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` echo \"Branch exists. Closing any open deploy requests and recreating.\"`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:' pr_url=\"https://github.com/${{ github.repository }}/pull/${{ github.event.pull_request.number }}\"'})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:\" stale_numbers=$(pscale deploy-request list ${{ secrets.PLANETSCALE_DATABASE_NAME }} --org ${{ secrets.PLANETSCALE_ORG_NAME }} -f json \\\\\"})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` | jq -r --arg branch \"\\${{ env.PSCALE_BRANCH_NAME }}\" '.[] | select(.state == \"open\" and .branch == $branch) | .number')`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` for number in $stale_numbers; do`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` echo \"Commenting on and closing deploy request $number\"`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` jq -n --arg body \"This deploy request is stale. The schema in \\${pr_url} changed, so this DR is being closed and a new one will be opened.\" '{body: $body}' \\\\`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:' | pscale api organizations/${{ secrets.PLANETSCALE_ORG_NAME }}/databases/${{ secrets.PLANETSCALE_DATABASE_NAME }}/deploy-requests/\"$number\"/comments --org ${{ secrets.PLANETSCALE_ORG_NAME }} --input - \\\\'})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` || echo \"Warning: could not comment on deploy request $number\"`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:' pscale deploy-request close ${{ secrets.PLANETSCALE_DATABASE_NAME }} \"$number\" --org ${{ secrets.PLANETSCALE_ORG_NAME }}'})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` done`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` if [ -n \"$stale_numbers\" ]; then`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` echo \"STALE_DR_NUMBERS=$(echo $stale_numbers | tr '\\\\n' ' ')\" >> \"$GITHUB_ENV\"`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` fi`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:\" pscale branch delete ${{ secrets.PLANETSCALE_DATABASE_NAME }} ${{ env.PSCALE_BRANCH_NAME }} --org ${{ secrets.PLANETSCALE_ORG_NAME }} --force\"})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` fi`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`- `}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:`name`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`Create branch`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` env`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` PLANETSCALE_SERVICE_TOKEN_ID`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:\"${{ secrets.PLANETSCALE_SERVICE_TOKEN_ID }}\"})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` PLANETSCALE_SERVICE_TOKEN`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:\"${{ secrets.PLANETSCALE_SERVICE_TOKEN }}\"})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` run`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:\"pscale branch create ${{ secrets.PLANETSCALE_DATABASE_NAME }} ${{ env.PSCALE_BRANCH_NAME }} --org ${{ secrets.PLANETSCALE_ORG_NAME }} --wait\"})]}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`The numbers of any closed deploy requests are saved to `,_jsx(_components.code,{children:\"${{ env.STALE_DR_NUMBERS }}\"}),`, so a later step can mention which deploy request was replaced when commenting on the pull request.`]}),`\n`,_jsxs(_components.p,{children:[`Pair this with a `,_jsx(_components.code,{children:`concurrency`}),` group keyed on the git branch so two pushes in quick succession don’t delete and create the same PlanetScale branch at the same time.`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`3`,language:`yaml`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`yaml`,children:_jsxs(_components.code,{language:`yaml`,numberOfLines:`3`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:`concurrency`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` group`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:\"ps-migrations-${{ github.head_ref }}\"})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` cancel-in-progress`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:`true`})]}),`\n`]})})}),`\n`,_jsx(Heading,{level:`3`,id:`create-a-password-for-a-branch`,children:`Create a password for a branch`}),`\n`,_jsxs(_components.p,{children:[`You can use `,_jsx(_components.code,{children:`pscale password create`}),` to generate credentials for your database branch.`]}),`\n`,_jsx(CodeBlock,{filename:``,expandable:`true`,numberOfLines:`24`,language:`yaml`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`yaml`,children:_jsxs(_components.code,{language:`yaml`,numberOfLines:`24`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`- `}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:`name`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`Generate password for branch`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` env`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` PLANETSCALE_SERVICE_TOKEN_ID`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:\"${{ secrets.PLANETSCALE_SERVICE_TOKEN_ID }}\"})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` PLANETSCALE_SERVICE_TOKEN`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:\"${{ secrets.PLANETSCALE_SERVICE_TOKEN }}\"})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` run`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`|`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:' response=$(pscale password create ${{ secrets.PLANETSCALE_DATABASE_NAME }} ${{ env.PSCALE_BRANCH_NAME }} \"\" -f json --org ${{ secrets.PLANETSCALE_ORG_NAME }})'})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` id=$(echo \"$response\" | jq -r '.id')`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` host=$(echo \"$response\" | jq -r '.access_host_url')`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` username=$(echo \"$response\" | jq -r '.username')`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` password=$(echo \"$response\" | jq -r '.plain_text')`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` ssl_mode=\"verify_identity\" # Assuming a default value for ssl_mode`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` ssl_ca=\"/etc/ssl/certs/ca-certificates.crt\" # Assuming a default value for ssl_ca`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` # Set the password ID, allows us to later delete it if wanted.`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` echo \"PASSWORD_ID=$id\" >> $GITHUB_ENV`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` # Create the DATABASE_URL`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:' database_url=\"mysql://$username:$password@$host/${{ secrets.PLANETSCALE_DATABASE_NAME }}?sslmode=$ssl_mode\u0026sslca=$ssl_ca\"'})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` echo \"DATABASE_URL=$database_url\" >> $GITHUB_ENV`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` echo \"::add-mask::$DATABASE_URL\"`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`- `}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:`name`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`Use the DATABASE_URL in a subsequent step`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` run`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`|`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` echo \"Using DATABASE_URL: $DATABASE_URL\"`})}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`This example shows creating the password and getting back a response in json. The json is then parsed to create a `,_jsx(_components.code,{children:`DATABASE_URL`}),` which can be used in later steps.`]}),`\n`,_jsx(Note,{children:_jsxs(_components.p,{children:[_jsx(_components.code,{children:`pscale password create`}),` can also accept a `,_jsx(_components.code,{children:`ttl`}),` flag which lets you limit the number of minutes the password is valid for.`]})}),`\n`,_jsx(Heading,{level:`3`,id:`open-a-deploy-request`,children:`Open a deploy request`}),`\n`,_jsxs(_components.p,{children:[`You can use `,_jsx(_components.code,{children:`pscale deploy-request create`}),` to open a new deploy request from GitHub Actions.\nThis can be useful after running migrations against a branch.`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`9`,language:`yaml`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`yaml`,children:_jsxs(_components.code,{language:`yaml`,numberOfLines:`9`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`- `}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:`name`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`Open DR if migrations`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` env`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` PLANETSCALE_SERVICE_TOKEN_ID`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:\"${{ secrets.PLANETSCALE_SERVICE_TOKEN_ID }}\"})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` PLANETSCALE_SERVICE_TOKEN`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:\"${{ secrets.PLANETSCALE_SERVICE_TOKEN }}\"})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` run`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`|`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:\" pscale deploy-request create ${{ secrets.PLANETSCALE_DATABASE_NAME }} ${{ env.PSCALE_BRANCH_NAME }} \\\\\"})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:\" --org ${{ secrets.PLANETSCALE_ORG_NAME }} \\\\\"})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` --auto-delete-branch \\\\`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:' --notes \"https://github.com/${{ github.repository }}/pull/${{ github.event.pull_request.number }}\"'})}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.code,{children:`--auto-delete-branch`}),` deletes the PlanetScale branch once the deploy request completes, so CI branches don’t accumulate. `,_jsx(_components.code,{children:`--notes`}),` links the deploy request back to the pull request that created it.`]}),`\n`,_jsx(Heading,{level:`3`,id:`get-deploy-request-by-branch-name`,children:`Get deploy request by branch name`}),`\n`,_jsxs(_components.p,{children:[`You can use `,_jsx(_components.code,{children:`pscale deploy-requests show`}),` to grab the latest deploy request by branch name.`]}),`\n`,_jsx(_components.p,{children:`This can be useful when deploying your application. You can first check if there are any deploy requests open for the branch being deployed. If there are, you can\ntrigger the deploy request to run before you deploy your application.`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`7`,language:`yaml`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`yaml`,children:_jsxs(_components.code,{language:`yaml`,numberOfLines:`7`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`- `}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:`name`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`Get Deploy Requests`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` env`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` PLANETSCALE_SERVICE_TOKEN_ID`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:\"${{ secrets.PLANETSCALE_SERVICE_TOKEN_ID }}\"})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` PLANETSCALE_SERVICE_TOKEN`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:\"${{ secrets.PLANETSCALE_SERVICE_TOKEN }}\"})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` run`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`|`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:\" deploy_request_number=$(pscale deploy-request show ${{ secrets.PLANETSCALE_DATABASE_NAME }} ${{ env.PSCALE_BRANCH_NAME }} --org ${{ secrets.PLANETSCALE_ORG_NAME }} -f json | jq -r '.number')\"})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` echo \"DEPLOY_REQUEST_NUMBER=$deploy_request_number\" >> $GITHUB_ENV`})}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`This example also makes the deploy request number available as an `,_jsx(_components.code,{children:`env`}),` var so that it can be used in later steps.`]}),`\n`,_jsx(Heading,{level:`3`,id:`get-deploy-request-diff-and-comment-on-pull-request`,children:`Get deploy request diff and comment on pull request`}),`\n`,_jsxs(_components.p,{children:[`We can use `,_jsx(_components.code,{children:`pscale deploy-request diff`}),` to see the full schema diff of a deploy request.`]}),`\n`,_jsx(_components.p,{children:`This example is useful when combined with opening a deploy request for a git branch. You can then automatically comment the diff back to the GitHub pull request.`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`14`,language:`yaml`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`yaml`,children:_jsxs(_components.code,{language:`yaml`,numberOfLines:`14`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`- `}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:`name`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`Comment on PR`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` env`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` PLANETSCALE_SERVICE_TOKEN_ID`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:\"${{ secrets.PLANETSCALE_SERVICE_TOKEN_ID }}\"})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` PLANETSCALE_SERVICE_TOKEN`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:\"${{ secrets.PLANETSCALE_SERVICE_TOKEN }}\"})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` run`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`|`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:' echo \"Deploy request opened: https://app.planetscale.com/${{ secrets.PLANETSCALE_ORG_NAME }}/${{ secrets.PLANETSCALE_DATABASE_NAME }}/deploy-requests/${{ env.DEPLOY_REQUEST_NUMBER }}\" >> migration-message.txt'})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` echo \"\" >> migration-message.txt`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:' echo \"\\\\`\\\\`\\\\`diff\" >> migration-message.txt'})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:\" pscale deploy-request diff ${{ secrets.PLANETSCALE_DATABASE_NAME }} ${{ env.DEPLOY_REQUEST_NUMBER }} --org ${{ secrets.PLANETSCALE_ORG_NAME }} -f json | jq -r '.[].raw' >> migration-message.txt\"})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:' echo \"\\\\`\\\\`\\\\`\" >> migration-message.txt'})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`- `}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:`name`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`Comment PR - db migrated`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` uses`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`thollander/actions-comment-pull-request@v2`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` with`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` filePath`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`migration-message.txt`})]}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`This writes the diff to the `,_jsx(_components.code,{children:`migration-message.txt`}),` file. And then creates a comment on the pull request that triggered the workflow.`]}),`\n`,_jsx(Heading,{level:`3`,id:`check-for-dropped-columns`,children:`Check for dropped columns`}),`\n`,_jsxs(_components.p,{children:[`PlanetScale sets a `,_jsx(_components.code,{children:`can_drop_data`}),` boolean for any schema change that drop a column or table. We can make use of this to emit a warning into our pull requests.`]}),`\n`,_jsxs(_components.p,{children:[`In this example, we first wait for the deployment check to be `,_jsx(_components.code,{children:`ready`}),`. During this time, PlanetScale is examining the schema change, verifying that it is safe and\ngenerating the DDL statements to make the change. Once it’s done, we then use this information to put a comment on the deploy request with tips on how to deploy it safely.`]}),`\n`,_jsx(CodeBlock,{filename:``,expandable:`true`,numberOfLines:`55`,language:`yaml`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`yaml`,children:_jsxs(_components.code,{language:`yaml`,numberOfLines:`55`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`- `}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:`name`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`Check deployment state`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` id`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`check-state`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` env`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` PLANETSCALE_SERVICE_TOKEN_ID`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:\"${{ secrets.PLANETSCALE_SERVICE_TOKEN_ID }}\"})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` PLANETSCALE_SERVICE_TOKEN`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:\"${{ secrets.PLANETSCALE_SERVICE_TOKEN }}\"})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` run`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`|`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` for i in {1..10}; do`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:\" deployment_state=$(pscale deploy-request show ${{ secrets.PLANETSCALE_ORG_NAME }} ${{ env.PSCALE_BRANCH_NAME }} --org ${{ secrets.PLANETSCALE_ORG_NAME }} --format json | jq -r '.deployment_state')\"})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` echo \"Deployment State: $deployment_state\"`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` if [ \"$deployment_state\" = \"ready\" ]; then`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` echo \"Deployment state is ready. Continuing.\"`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` break`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` fi`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` echo \"Deployment state is not ready. Waiting 2 seconds before checking again.\"`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` sleep 2`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` done`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` - `}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:`name`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`Comment PR - db migrated`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` if`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:\"${{ env.DR_OPENED }}\"})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` env`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` PLANETSCALE_SERVICE_TOKEN_ID`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:\"${{ secrets.PLANETSCALE_SERVICE_TOKEN_ID }}\"})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` PLANETSCALE_SERVICE_TOKEN`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:\"${{ secrets.PLANETSCALE_SERVICE_TOKEN }}\"})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` run`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`|`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:\" deploy_data=$(pscale api organizations/${{ secrets.PLANETSCALE_ORG_NAME }}/databases/${{ secrets.PLANETSCALE_DATABASE_NAME }}/deploy-requests/${{ env.DEPLOY_REQUEST_NUMBER }}/deployment --org planetscale)\"})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` can_drop_data=$(echo \"$deploy_data\" | jq -r '.deploy_operations[] | select(.can_drop_data == true) | .can_drop_data')`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:' echo \"Deploy request opened: https://app.planetscale.com/${{ secrets.PLANETSCALE_ORG_NAME }}/${{ secrets.PLANETSCALE_DATABASE_NAME }}/deploy-requests/${{ env.DEPLOY_REQUEST_NUMBER }}\" >> migration-message.txt'})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` echo \"\" >> migration-message.txt`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` if [ \"$can_drop_data\" = \"true\" ]; then`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` echo \":rotating_light: You are dropping a column. Before running the migration make sure to do the following:\" >> migration-message.txt`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` echo \"\" >> migration-message.txt`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` echo \"1. [ ] Deploy app changes to ensure the column is no longer being used.\" >> migration-message.txt`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` echo \"2. [ ] Once you've verified it's no used, run the deploy request.\" >> migration-message.txt`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` echo \"\" >> migration-message.txt`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` else`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` echo \"When adding to the schema, the Deploy Request must be run **before** the code is deployed.\" >> migration-message.txt`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` echo \"Please ensure your schema changes are compatible with the application code currently running in production.\" >> migration-message.txt`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` echo \"\" >> migration-message.txt`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` echo \"1. [ ] Successfully run the Deploy Request\" >> migration-message.txt`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` echo \"2. [ ] Deploy this PR\" >> migration-message.txt`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` echo \"\" >> migration-message.txt`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` fi`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:' echo \"\\\\`\\\\`\\\\`diff\" >> migration-message.txt'})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:\" pscale deploy-request diff ${{ secrets.PLANETSCALE_ORG_NAME }} ${{ env.DEPLOY_REQUEST_NUMBER }} -f json | jq -r '.[].raw' >> migration-message.txt\"})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:' echo \"\\\\`\\\\`\\\\`\" >> migration-message.txt'})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` - `}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:`name`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`Comment PR - db migrated`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` uses`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`thollander/actions-comment-pull-request@v2`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` if`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:\"${{ env.DR_OPENED }}\"})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` with`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` filePath`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`migration-message.txt`})]}),`\n`]})})}),`\n`,_jsx(Heading,{level:`3`,id:`submit-a-deploy-request-by-branch-name`,children:`Submit a deploy request by branch name`}),`\n`,_jsxs(_components.p,{children:[`To trigger a deploy, we can use `,_jsx(_components.code,{children:`pscale deploy-request deploy`}),`. This command will accept either the deploy request number, or the name of the branch that the deploy request was created from.`]}),`\n`,_jsx(_components.p,{children:`When using with GitHub Actions, it’s often easier to use the branch name.`}),`\n`,_jsxs(_components.p,{children:[`The `,_jsx(_components.code,{children:`--wait`}),` flag will let the command run until the deployment is complete. This is important if you want your schema change to run before the next step in your workflow.`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`6`,language:`yaml`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`yaml`,children:_jsxs(_components.code,{language:`yaml`,numberOfLines:`6`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`- `}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:`name`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`Deploy schema migrations`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` env`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` PLANETSCALE_SERVICE_TOKEN_ID`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:\"${{ secrets.PLANETSCALE_SERVICE_TOKEN_ID }}\"})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` PLANETSCALE_SERVICE_TOKEN`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:\"${{ secrets.PLANETSCALE_SERVICE_TOKEN }}\"})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` run`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`|`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:\" pscale deploy-request deploy ${{ secrets.PLANETSCALE_DATABASE_NAME }} ${{ env.PSCALE_BRANCH_NAME }} --org ${{ secrets.PLANETSCALE_ORG_NAME }} --wait\"})}),`\n`]})})}),`\n`,_jsx(Heading,{level:`2`,id:`need-help`,children:`Need help?`}),`\n`,_jsxs(_components.p,{children:[`Get help from `,_jsx(_components.a,{href:`https://planetscale.com/contact?initial=support`,children:`the PlanetScale Support team`}),`, or join our\\xA0`,_jsx(_components.a,{href:`https://pscale.link/community`,children:`Discord community`}),` to see how others are using PlanetScale.`]})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{__snippet_platformLabels_3vlljw,__snippet_combinedPlatformLabels_3vlljw,__snippet_platformBadgeClassName_3vlljw,__snippet_docsHref_3vlljw,__snippet_PlatformAvailabilityBadges_3vlljw,__snippet_PlatformAvailabilityText_3vlljw,PlatformAvailability,default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"PlanetScale GitHub Actions","sidebarTitle":"Automating with GitHub Actions","og:image":"images/og/vitess/integrations/github-actions.png","description":null,"href":"/vitess/integrations/github-actions"}}},"mdxSourceWithNoJs":null,"noJsSplices":[[166,14628,"undefined;const __snippet_combinedPlatformLabels_3vlljw=undefined;const __snippet_platformBadgeClassName_3vlljw=undefined;const __snippet_docsHref_3vlljw=()=>null;const __snippet_PlatformAvailabilityBadges_3vlljw=()=>null;const __snippet_PlatformAvailabilityText_3vlljw=()=>null;const PlatformAvailability=()=>null;funct"]]},"mdxExtracts":{"tableOfContents":[{"title":"Getting started","slug":"getting-started","depth":2,"children":[]},{"title":"Authentication","slug":"authentication","depth":2,"children":[]},{"title":"Examples","slug":"examples","depth":2,"children":[{"title":"Convert GitHub branch name to PlanetScale branch name","slug":"convert-github-branch-name-to-planetscale-branch-name","depth":3,"children":[]},{"title":"Create a PlanetScale branch","slug":"create-a-planetscale-branch","depth":3,"children":[]},{"title":"Recreate the branch when the pull request changes","slug":"recreate-the-branch-when-the-pull-request-changes","depth":3,"children":[]},{"title":"Create a password for a branch","slug":"create-a-password-for-a-branch","depth":3,"children":[]},{"title":"Open a deploy request","slug":"open-a-deploy-request","depth":3,"children":[]},{"title":"Get deploy request by branch name","slug":"get-deploy-request-by-branch-name","depth":3,"children":[]},{"title":"Get deploy request diff and comment on pull request","slug":"get-deploy-request-diff-and-comment-on-pull-request","depth":3,"children":[]},{"title":"Check for dropped columns","slug":"check-for-dropped-columns","depth":3,"children":[]},{"title":"Submit a deploy request by branch name","slug":"submit-a-deploy-request-by-branch-name","depth":3,"children":[]}]},{"title":"Need help?","slug":"need-help","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":["/docs/_mintlify/custom/planetscale-2/b155242ec3c4945e/custom.js"],"dynamicCss":".mint-mb-5 {\n margin-bottom: 1.25rem\n}\n.mint-flex {\n display: flex\n}\n.mint-inline-flex {\n display: inline-flex\n}\n.mint-shrink-0 {\n flex-shrink: 0\n}\n.mint-flex-wrap {\n flex-wrap: wrap\n}\n.mint-items-center {\n align-items: center\n}\n.mint-gap-1\\.5 {\n gap: 0.375rem\n}\n.mint-gap-2 {\n gap: 0.5rem\n}\n.mint-whitespace-nowrap {\n white-space: nowrap\n}\n.mint-rounded-full {\n border-radius: 9999px\n}\n.mint-border {\n border-width: 1px\n}\n.mint-px-2\\.5 {\n padding-left: 0.625rem;\n padding-right: 0.625rem\n}\n.mint-py-1 {\n padding-top: 0.25rem;\n padding-bottom: 0.25rem\n}\n.mint-text-\\[13px\\] {\n font-size: 13px\n}\n.mint-font-semibold {\n font-weight: 600\n}\n.mint-leading-tight {\n line-height: 1.25\n}\n.mint-no-underline {\n text-decoration-line: none\n}\n.data-\\[engine\\=both\\]\\:data-\\[state\\=current\\]\\:mint-border-\\[\\#d4d4d4\\][data-state=\"current\"][data-engine=\"both\"] {\n --tw-border-opacity: 1;\n border-color: rgb(212 212 212 / var(--tw-border-opacity, 1))\n}\n.data-\\[engine\\=neki\\]\\:data-\\[state\\=current\\]\\:mint-border-\\[\\#fbca00\\][data-state=\"current\"][data-engine=\"neki\"] {\n --tw-border-opacity: 1;\n border-color: rgb(251 202 0 / var(--tw-border-opacity, 1))\n}\n.data-\\[engine\\=neki\\]\\:data-\\[state\\=link\\]\\:mint-border-\\[\\#fbca00\\][data-state=\"link\"][data-engine=\"neki\"] {\n --tw-border-opacity: 1;\n border-color: rgb(251 202 0 / var(--tw-border-opacity, 1))\n}\n.data-\\[engine\\=postgres\\]\\:data-\\[state\\=current\\]\\:mint-border-\\[\\#a9dffe\\][data-state=\"current\"][data-engine=\"postgres\"] {\n --tw-border-opacity: 1;\n border-color: rgb(169 223 254 / var(--tw-border-opacity, 1))\n}\n.data-\\[engine\\=postgres\\]\\:data-\\[state\\=link\\]\\:mint-border-\\[\\#a9dffe\\][data-state=\"link\"][data-engine=\"postgres\"] {\n --tw-border-opacity: 1;\n border-color: rgb(169 223 254 / var(--tw-border-opacity, 1))\n}\n.data-\\[engine\\=vitess\\]\\:data-\\[state\\=current\\]\\:mint-border-\\[\\#ffc59b\\][data-state=\"current\"][data-engine=\"vitess\"] {\n --tw-border-opacity: 1;\n border-color: rgb(255 197 155 / var(--tw-border-opacity, 1))\n}\n.data-\\[engine\\=vitess\\]\\:data-\\[state\\=link\\]\\:mint-border-\\[\\#ffc59b\\][data-state=\"link\"][data-engine=\"vitess\"] {\n --tw-border-opacity: 1;\n border-color: rgb(255 197 155 / var(--tw-border-opacity, 1))\n}\n.data-\\[engine\\=both\\]\\:data-\\[state\\=current\\]\\:mint-bg-\\[\\#f0f0f0\\][data-state=\"current\"][data-engine=\"both\"] {\n --tw-bg-opacity: 1;\n background-color: rgb(240 240 240 / var(--tw-bg-opacity, 1))\n}\n.data-\\[engine\\=neki\\]\\:data-\\[state\\=current\\]\\:mint-bg-\\[\\#fbca00\\][data-state=\"current\"][data-engine=\"neki\"] {\n --tw-bg-opacity: 1;\n background-color: rgb(251 202 0 / var(--tw-bg-opacity, 1))\n}\n.data-\\[engine\\=neki\\]\\:data-\\[state\\=link\\]\\:mint-bg-transparent[data-state=\"link\"][data-engine=\"neki\"] {\n background-color: transparent\n}\n.data-\\[engine\\=postgres\\]\\:data-\\[state\\=current\\]\\:mint-bg-\\[\\#ddf2ff\\][data-state=\"current\"][data-engine=\"postgres\"] {\n --tw-bg-opacity: 1;\n background-color: rgb(221 242 255 / var(--tw-bg-opacity, 1))\n}\n.data-\\[engine\\=postgres\\]\\:data-\\[state\\=link\\]\\:mint-bg-transparent[data-state=\"link\"][data-engine=\"postgres\"] {\n background-color: transparent\n}\n.data-\\[engine\\=vitess\\]\\:data-\\[state\\=current\\]\\:mint-bg-\\[\\#ffe8d8\\][data-state=\"current\"][data-engine=\"vitess\"] {\n --tw-bg-opacity: 1;\n background-color: rgb(255 232 216 / var(--tw-bg-opacity, 1))\n}\n.data-\\[engine\\=vitess\\]\\:data-\\[state\\=link\\]\\:mint-bg-transparent[data-state=\"link\"][data-engine=\"vitess\"] {\n background-color: transparent\n}\n.data-\\[engine\\=both\\]\\:data-\\[state\\=current\\]\\:mint-text-\\[\\#3d3d3d\\][data-state=\"current\"][data-engine=\"both\"] {\n --tw-text-opacity: 1;\n color: rgb(61 61 61 / var(--tw-text-opacity, 1))\n}\n.data-\\[engine\\=neki\\]\\:data-\\[state\\=current\\]\\:mint-text-\\[\\#1a1a1a\\][data-state=\"current\"][data-engine=\"neki\"] {\n --tw-text-opacity: 1;\n color: rgb(26 26 26 / var(--tw-text-opacity, 1))\n}\n.data-\\[engine\\=neki\\]\\:data-\\[state\\=link\\]\\:mint-text-\\[\\#8f7200\\][data-state=\"link\"][data-engine=\"neki\"] {\n --tw-text-opacity: 1;\n color: rgb(143 114 0 / var(--tw-text-opacity, 1))\n}\n.data-\\[engine\\=postgres\\]\\:data-\\[state\\=current\\]\\:mint-text-\\[\\#0e3682\\][data-state=\"current\"][data-engine=\"postgres\"] {\n --tw-text-opacity: 1;\n color: rgb(14 54 130 / var(--tw-text-opacity, 1))\n}\n.data-\\[engine\\=postgres\\]\\:data-\\[state\\=link\\]\\:mint-text-\\[\\#0b6ec5\\][data-state=\"link\"][data-engine=\"postgres\"] {\n --tw-text-opacity: 1;\n color: rgb(11 110 197 / var(--tw-text-opacity, 1))\n}\n.data-\\[engine\\=vitess\\]\\:data-\\[state\\=current\\]\\:mint-text-\\[\\#672002\\][data-state=\"current\"][data-engine=\"vitess\"] {\n --tw-text-opacity: 1;\n color: rgb(103 32 2 / var(--tw-text-opacity, 1))\n}\n.data-\\[engine\\=vitess\\]\\:data-\\[state\\=link\\]\\:mint-text-\\[\\#b83a05\\][data-state=\"link\"][data-engine=\"vitess\"] {\n --tw-text-opacity: 1;\n color: rgb(184 58 5 / var(--tw-text-opacity, 1))\n}\n.dark\\:data-\\[engine\\=both\\]\\:data-\\[state\\=current\\]\\:mint-border-\\[\\#525252\\][data-state=\"current\"][data-engine=\"both\"]:is(.dark *) {\n --tw-border-opacity: 1;\n border-color: rgb(82 82 82 / var(--tw-border-opacity, 1))\n}\n.dark\\:data-\\[engine\\=neki\\]\\:data-\\[state\\=current\\]\\:mint-border-\\[\\#fbca00\\][data-state=\"current\"][data-engine=\"neki\"]:is(.dark *) {\n --tw-border-opacity: 1;\n border-color: rgb(251 202 0 / var(--tw-border-opacity, 1))\n}\n.dark\\:data-\\[engine\\=neki\\]\\:data-\\[state\\=link\\]\\:mint-border-\\[\\#fbca00\\][data-state=\"link\"][data-engine=\"neki\"]:is(.dark *) {\n --tw-border-opacity: 1;\n border-color: rgb(251 202 0 / var(--tw-border-opacity, 1))\n}\n.dark\\:data-\\[engine\\=postgres\\]\\:data-\\[state\\=current\\]\\:mint-border-\\[\\#144eb6\\][data-state=\"current\"][data-engine=\"postgres\"]:is(.dark *) {\n --tw-border-opacity: 1;\n border-color: rgb(20 78 182 / var(--tw-border-opacity, 1))\n}\n.dark\\:data-\\[engine\\=postgres\\]\\:data-\\[state\\=link\\]\\:mint-border-\\[\\#144eb6\\][data-state=\"link\"][data-engine=\"postgres\"]:is(.dark *) {\n --tw-border-opacity: 1;\n border-color: rgb(20 78 182 / var(--tw-border-opacity, 1))\n}\n.dark\\:data-\\[engine\\=vitess\\]\\:data-\\[state\\=current\\]\\:mint-border-\\[\\#962d00\\][data-state=\"current\"][data-engine=\"vitess\"]:is(.dark *) {\n --tw-border-opacity: 1;\n border-color: rgb(150 45 0 / var(--tw-border-opacity, 1))\n}\n.dark\\:data-\\[engine\\=vitess\\]\\:data-\\[state\\=link\\]\\:mint-border-\\[\\#962d00\\][data-state=\"link\"][data-engine=\"vitess\"]:is(.dark *) {\n --tw-border-opacity: 1;\n border-color: rgb(150 45 0 / var(--tw-border-opacity, 1))\n}\n.dark\\:data-\\[engine\\=both\\]\\:data-\\[state\\=current\\]\\:mint-bg-\\[\\#2a2a2a\\][data-state=\"current\"][data-engine=\"both\"]:is(.dark *) {\n --tw-bg-opacity: 1;\n background-color: rgb(42 42 42 / var(--tw-bg-opacity, 1))\n}\n.dark\\:data-\\[engine\\=neki\\]\\:data-\\[state\\=current\\]\\:mint-bg-\\[\\#fbca00\\][data-state=\"current\"][data-engine=\"neki\"]:is(.dark *) {\n --tw-bg-opacity: 1;\n background-color: rgb(251 202 0 / var(--tw-bg-opacity, 1))\n}\n.dark\\:data-\\[engine\\=neki\\]\\:data-\\[state\\=link\\]\\:mint-bg-transparent[data-state=\"link\"][data-engine=\"neki\"]:is(.dark *) {\n background-color: transparent\n}\n.dark\\:data-\\[engine\\=postgres\\]\\:data-\\[state\\=current\\]\\:mint-bg-\\[\\#08204e\\][data-state=\"current\"][data-engine=\"postgres\"]:is(.dark *) {\n --tw-bg-opacity: 1;\n background-color: rgb(8 32 78 / var(--tw-bg-opacity, 1))\n}\n.dark\\:data-\\[engine\\=postgres\\]\\:data-\\[state\\=link\\]\\:mint-bg-transparent[data-state=\"link\"][data-engine=\"postgres\"]:is(.dark *) {\n background-color: transparent\n}\n.dark\\:data-\\[engine\\=vitess\\]\\:data-\\[state\\=current\\]\\:mint-bg-\\[\\#3c1403\\][data-state=\"current\"][data-engine=\"vitess\"]:is(.dark *) {\n --tw-bg-opacity: 1;\n background-color: rgb(60 20 3 / var(--tw-bg-opacity, 1))\n}\n.dark\\:data-\\[engine\\=vitess\\]\\:data-\\[state\\=link\\]\\:mint-bg-transparent[data-state=\"link\"][data-engine=\"vitess\"]:is(.dark *) {\n background-color: transparent\n}\n.dark\\:data-\\[engine\\=both\\]\\:data-\\[state\\=current\\]\\:mint-text-\\[\\#e5e5e5\\][data-state=\"current\"][data-engine=\"both\"]:is(.dark *) {\n --tw-text-opacity: 1;\n color: rgb(229 229 229 / var(--tw-text-opacity, 1))\n}\n.dark\\:data-\\[engine\\=neki\\]\\:data-\\[state\\=current\\]\\:mint-text-\\[\\#1a1a1a\\][data-state=\"current\"][data-engine=\"neki\"]:is(.dark *) {\n --tw-text-opacity: 1;\n color: rgb(26 26 26 / var(--tw-text-opacity, 1))\n}\n.dark\\:data-\\[engine\\=neki\\]\\:data-\\[state\\=link\\]\\:mint-text-\\[\\#fbca00\\][data-state=\"link\"][data-engine=\"neki\"]:is(.dark *) {\n --tw-text-opacity: 1;\n color: rgb(251 202 0 / var(--tw-text-opacity, 1))\n}\n.dark\\:data-\\[engine\\=postgres\\]\\:data-\\[state\\=current\\]\\:mint-text-\\[\\#ddf2ff\\][data-state=\"current\"][data-engine=\"postgres\"]:is(.dark *) {\n --tw-text-opacity: 1;\n color: rgb(221 242 255 / var(--tw-text-opacity, 1))\n}\n.dark\\:data-\\[engine\\=postgres\\]\\:data-\\[state\\=link\\]\\:mint-text-\\[\\#73c7f9\\][data-state=\"link\"][data-engine=\"postgres\"]:is(.dark *) {\n --tw-text-opacity: 1;\n color: rgb(115 199 249 / var(--tw-text-opacity, 1))\n}\n.dark\\:data-\\[engine\\=vitess\\]\\:data-\\[state\\=current\\]\\:mint-text-\\[\\#ffe8d8\\][data-state=\"current\"][data-engine=\"vitess\"]:is(.dark *) {\n --tw-text-opacity: 1;\n color: rgb(255 232 216 / var(--tw-text-opacity, 1))\n}\n.dark\\:data-\\[engine\\=vitess\\]\\:data-\\[state\\=link\\]\\:mint-text-\\[\\#ffc59b\\][data-state=\"link\"][data-engine=\"vitess\"]:is(.dark *) {\n --tw-text-opacity: 1;\n color: rgb(255 197 155 / var(--tw-text-opacity, 1))\n}","subdomain":"planetscale-2","siteName":"PlanetScale","title":"PlanetScale GitHub Actions - PlanetScale","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-10-27T16:12:40.866Z","originalFileLocation":"vitess/integrations/github-actions.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"system\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"application-name\" content=\"PlanetScale\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/docs/mintlify-assets/_mintlify/favicons/planetscale-2/_bFyi8IG4CeLblEd/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/docs/mintlify-assets/_mintlify/favicons/planetscale-2/_bFyi8IG4CeLblEd/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/docs/mintlify-assets/_mintlify/favicons/planetscale-2/_bFyi8IG4CeLblEd/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/docs/mintlify-assets/_mintlify/favicons/planetscale-2/_bFyi8IG4CeLblEd/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/docs/mintlify-assets/_mintlify/favicons/planetscale-2/_bFyi8IG4CeLblEd/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/docs/mintlify-assets/_mintlify/favicons/planetscale-2/_bFyi8IG4CeLblEd/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/docs/mintlify-assets/_mintlify/favicons/planetscale-2/_bFyi8IG4CeLblEd/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/docs/mintlify-assets/_mintlify/favicons/planetscale-2/_bFyi8IG4CeLblEd/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/docs/mintlify-assets/_mintlify/favicons/planetscale-2/_bFyi8IG4CeLblEd/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"PlanetScale GitHub Actions - PlanetScale\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"PlanetScale\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://planetscale.com/docs/vitess/integrations/github-actions\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://planetscale-2.mintlify.app/images/og/vitess/integrations/github-actions.png\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"PlanetScale GitHub Actions - PlanetScale\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://planetscale-2.mintlify.app/images/og/vitess/integrations/github-actions.png\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/docs/mintlify-assets/_mintlify/favicons/planetscale-2/_bFyi8IG4CeLblEd/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"PlanetScale\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#0e73cc\">\u003clink data-mint-head rel=\"canonical\" href=\"https://planetscale.com/docs/vitess/integrations/github-actions\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/docs/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/docs/vitess/integrations/github-actions.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://planetscale.com/#organization\",\"name\":\"PlanetScale\",\"url\":\"https://planetscale.com\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/planetscale-2/xUilVHToUFALai8a/logo/light.png?fit=max\u0026auto=format\u0026n=xUilVHToUFALai8a\u0026q=85\u0026s=cccd3c9fc813c01b899ab7af15a115b1\"}},{\"@type\":\"WebSite\",\"@id\":\"https://planetscale.com/docs#website\",\"name\":\"PlanetScale\",\"url\":\"https://planetscale.com/docs\",\"publisher\":{\"@id\":\"https://planetscale.com/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://planetscale.com/docs/vitess/integrations/github-actions#webpage\",\"url\":\"https://planetscale.com/docs/vitess/integrations/github-actions\",\"name\":\"PlanetScale GitHub Actions\",\"dateModified\":\"2026-10-27T16:12:40.866Z\",\"isPartOf\":{\"@id\":\"https://planetscale.com/docs#website\"},\"breadcrumb\":{\"@id\":\"https://planetscale.com/docs/vitess/integrations/github-actions#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://planetscale.com/docs/vitess/integrations/github-actions#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Platform\",\"item\":\"https://planetscale.com/docs/vitess/architecture\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Schema changes\",\"item\":\"https://planetscale.com/docs/vitess/schema-changes\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Schema changes\",\"item\":\"https://planetscale.com/docs/vitess/schema-changes/how-to-make-different-types-of-schema-changes\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"PlanetScale GitHub Actions\",\"item\":\"https://planetscale.com/docs/vitess/integrations/github-actions\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://planetscale.com/docs/vitess/integrations/github-actions#article\",\"headline\":\"PlanetScale GitHub Actions\",\"name\":\"PlanetScale GitHub Actions\",\"url\":\"https://planetscale.com/docs/vitess/integrations/github-actions\",\"mainEntityOfPage\":{\"@id\":\"https://planetscale.com/docs/vitess/integrations/github-actions#webpage\"},\"image\":\"https://planetscale.com/docs/images/og/vitess/integrations/github-actions.png\",\"dateModified\":\"2026-10-27T16:12:40.866Z\",\"publisher\":{\"@id\":\"https://planetscale.com/#organization\"},\"isPartOf\":{\"@id\":\"https://planetscale.com/docs#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"PlanetScale\",\"creator\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","siteName":"PlanetScale","nav":{"global":{"anchors":[{"anchor":"Blog","icon":"newspaper","href":"https://planetscale.com/blog"},{"anchor":"Contact Us","icon":"headset","href":"https://planetscale.com/contact"},{"anchor":"Status","icon":"signal","href":"https://www.planetscalestatus.com/"},{"anchor":"Benchmarks","icon":"chart-line","href":"https://planetscale.com/benchmarks"}]},"tabs":[{"tab":"Platform","pages":[{"title":"Platform","href":""}]},{"tab":"Vitess","groups":[{"group":" ","pages":[{"title":"PlanetScale for Vitess","sidebarTitle":"Vitess","href":"/vitess"}]},{"group":"Pricing","pages":[{"title":"Pricing","href":"/vitess/pricing"}]},{"group":"Platform","pages":[{"group":"Getting Started","pages":[{"title":"PlanetScale Vitess architecture","sidebarTitle":"Vitess architecture","href":"/vitess/architecture"},{"title":"PlanetScale workflow for Vitess","sidebarTitle":"Vitess workflow","href":"/vitess/best-practices"},{"title":"PlanetScale Vitess quickstart guide","sidebarTitle":"Step-by-step guide","href":"/vitess/tutorials/planetscale-quick-start-guide"},{"title":"Cluster sizing","sidebarTitle":"Cluster sizing","href":"/plans/cluster-sizing"},{"title":"Cluster configuration","href":"/vitess/cluster-configuration"},{"title":"Disk autoscaling","href":"/vitess/cluster-configuration/disk-autoscaling"},{"title":"Cluster configuration parameters","sidebarTitle":"Parameters","href":"/vitess/cluster-configuration/parameters"},{"title":"Per-shard sizing","href":"/vitess/cluster-configuration/per-shard-sizing"},{"title":"Database replicas","sidebarTitle":"Replicas","href":"/vitess/replicas"},{"title":"Foreign key constraints","sidebarTitle":"Foreign key constraints support","href":"/vitess/foreign-key-constraints"},{"title":"Web console","sidebarTitle":"Web console","href":"/vitess/web-console"},{"title":"PlanetScale terminology","sidebarTitle":"Terminology","href":"/vitess/terminology"},{"title":"MySQL compatibility","sidebarTitle":"MySQL compatibility","href":"/vitess/mysql-compatibility"}]},{"group":"Imports","pages":[{"title":"Discovery Tool","sidebarTitle":"Discovery tool","href":"/vitess/imports/discovery-tool"},{"title":"What are workflows?","sidebarTitle":"Workflows","href":"/vitess/scaling/workflows"},{"group":"Database imports","pages":[{"title":"Database imports","href":"/vitess/imports/database-imports"},{"title":"Import public IP addresses","href":"/vitess/imports/import-tool-migration-addresses"},{"title":"Import user permissions","href":"/vitess/imports/import-tool-user-requirements"},{"title":"Import troubleshooting","href":"/vitess/imports/import-troubleshooting"}]},{"group":"MySQL to PlanetScale Vitess migration","pages":[{"title":"Amazon Aurora migration guide","sidebarTitle":"Amazon Aurora","href":"/vitess/imports/amazon-aurora-migration-guide"},{"title":"AWS RDS migration guide","sidebarTitle":"Amazon RDS","href":"/vitess/imports/aws-rds-migration-guide"},{"title":"Azure Database for MySQL migration guide","sidebarTitle":"Azure","href":"/vitess/imports/azure-database-for-mysql-migration-guide"},{"title":"DigitalOcean database migration guide","sidebarTitle":"DigitalOcean","href":"/vitess/imports/digitalocean-database-migration-guide"},{"title":"GCP Cloud SQL Migration Guide","sidebarTitle":"GCP Cloud SQL","href":"/vitess/imports/gcp-cloudsql-migration-guide"},{"title":"MariaDB migration guide","sidebarTitle":"MariaDB","href":"/vitess/imports/mariadb-migration-guide"}]},{"group":"Postgres to PlanetScale Vitess migration","pages":[{"title":"Postgres to Vitess imports","sidebarTitle":"Postgres to Vitess overview","href":"/vitess/imports/postgres"},{"title":"Postgres to PlanetScale for Vitess migration guide","sidebarTitle":"Postgres to Vitess directly","href":"/vitess/imports/postgres-planetscale-migration-guide"},{"title":"Postgres to MySQL to PlanetScale migration guide","sidebarTitle":"Postgres to Vitess with intermediate MySQL","href":"/vitess/imports/postgres-mysql-planetscale-migration-guide"}]}]},{"group":"Connecting","pages":[{"title":"Connect any application to PlanetScale","sidebarTitle":"Connect any app","href":"/vitess/tutorials/connect-any-application"},{"title":"Connect a MySQL GUI to PlanetScale","sidebarTitle":"Connect a MySQL GUI","href":"/vitess/tutorials/connect-mysql-gui"},{"title":"Connection strings","href":"/vitess/connecting/connection-strings"},{"title":"Network latency","href":"/vitess/connecting/network-latency"},{"group":"MCP","pages":[{"title":"PlanetScale Model Context Protocol (MCP)","sidebarTitle":"Overview","href":"/mcp-server"},{"title":"Authenticate the MCP server with a service token","sidebarTitle":"Service tokens","href":"/mcp/service-token"}]},{"title":"Self-improving database","sidebarTitle":"Self-improving database","href":"/self-improving-database"},{"title":"PlanetScale Terraform provider","sidebarTitle":"Terraform provider","href":"/terraform"},{"group":"Private connections","pages":[{"title":"Connecting to PlanetScale privately on AWS","sidebarTitle":"AWS PrivateLink","href":"/vitess/connecting/private-connections"},{"title":"Connecting to PlanetScale privately on GCP","sidebarTitle":"GCP Private Service Connect","href":"/vitess/connecting/private-connections-gcp"}]}]},{"group":"Schema changes","pages":[{"title":"Non-blocking schema changes","href":"/vitess/schema-changes"},{"title":"Safe migrations","href":"/vitess/schema-changes/safe-migrations"},{"group":"Branching","pages":[{"title":"Branching","sidebarTitle":"Using branches","href":"/vitess/schema-changes/branching"},{"title":"Data Branching®","href":"/vitess/schema-changes/data-branching"}]},{"group":"Deploy requests","pages":[{"title":"Deploy requests","sidebarTitle":"Using deploy requests","href":"/vitess/schema-changes/deploy-requests"},{"title":"Throttling deploy requests","href":"/vitess/schema-changes/throttling-deploy-requests"},{"title":"Aggressive deploy request cutover","sidebarTitle":"Aggressive cutover","href":"/vitess/schema-changes/aggressive-cutover"},{"title":"Long-running transactions","sidebarTitle":"Long-running transactions","href":"/vitess/schema-changes/long-running-transactions"},{"title":"Column cannot be null","sidebarTitle":"Column cannot be null","href":"/vitess/schema-changes/column-cannot-be-null"},{"title":"Column has no default value","sidebarTitle":"Column has no default value","href":"/vitess/schema-changes/column-has-no-default"},{"title":"Duplicate entry for unique key","sidebarTitle":"Duplicate entry","href":"/vitess/schema-changes/duplicate-entry"},{"title":"Value does not fit the new column","sidebarTitle":"Value does not fit column","href":"/vitess/schema-changes/value-does-not-fit-column"},{"title":"Constraint not found","sidebarTitle":"Constraint not found","href":"/vitess/schema-changes/constraint-not-found"},{"title":"Foreign key missing unique key","sidebarTitle":"Foreign key missing unique key","href":"/vitess/schema-changes/foreign-key-missing-unique-key"},{"title":"Earlier migration failed","sidebarTitle":"Earlier migration failed","href":"/vitess/schema-changes/earlier-migration-failed"}]},{"group":"Schema lint errors","pages":[{"title":"Schema lint errors","sidebarTitle":"Schema lint errors","href":"/vitess/schema-changes/schema-lint-errors"},{"title":"UNSPECIFIED schema lint error","sidebarTitle":"UNSPECIFIED","href":"/vitess/schema-changes/schema-lint-errors/unspecified"},{"title":"NO_UNIQUE_KEY schema lint error","sidebarTitle":"NO_UNIQUE_KEY","href":"/vitess/schema-changes/schema-lint-errors/no-unique-key"},{"title":"FOREIGN_KEYS_DISALLOWED schema lint error","sidebarTitle":"FOREIGN_KEYS_DISALLOWED","href":"/vitess/schema-changes/schema-lint-errors/foreign-keys-disallowed"},{"title":"INVALID_CHARSET schema lint error","sidebarTitle":"INVALID_CHARSET","href":"/vitess/schema-changes/schema-lint-errors/invalid-charset"},{"title":"UNSUPPORTED_FEATURE schema lint error","sidebarTitle":"UNSUPPORTED_FEATURE","href":"/vitess/schema-changes/schema-lint-errors/unsupported-feature"},{"title":"UNSUPPORTED_SHARDED_FEATURE schema lint error","sidebarTitle":"UNSUPPORTED_SHARDED_FEATURE","href":"/vitess/schema-changes/schema-lint-errors/unsupported-sharded-feature"},{"title":"INVALID_VSCHEMA schema lint error","sidebarTitle":"INVALID_VSCHEMA","href":"/vitess/schema-changes/schema-lint-errors/invalid-vschema"},{"title":"DUPLICATE_ENUM_VALUE schema lint error","sidebarTitle":"DUPLICATE_ENUM_VALUE","href":"/vitess/schema-changes/schema-lint-errors/duplicate-enum-value"},{"title":"UNSUPPORTED_PARTITIONING_FEATURE schema lint error","sidebarTitle":"UNSUPPORTED_PARTITIONING_FEATURE","href":"/vitess/schema-changes/schema-lint-errors/unsupported-partitioning-feature"},{"title":"INVALID_TABLE_REFERENCED_IN_VIEW schema lint error","sidebarTitle":"INVALID_TABLE_REFERENCED_IN_VIEW","href":"/vitess/schema-changes/schema-lint-errors/invalid-table-referenced-in-view"},{"title":"INVALID_COLUMN_REFERENCED_IN_VIEW schema lint error","sidebarTitle":"INVALID_COLUMN_REFERENCED_IN_VIEW","href":"/vitess/schema-changes/schema-lint-errors/invalid-column-referenced-in-view"},{"title":"BLOB_IN_UNIQUE_KEY schema lint error","sidebarTitle":"BLOB_IN_UNIQUE_KEY","href":"/vitess/schema-changes/schema-lint-errors/blob-in-unique-key"},{"title":"PARTIAL_KEY_IN_UNIQUE_KEY schema lint error","sidebarTitle":"PARTIAL_KEY_IN_UNIQUE_KEY","href":"/vitess/schema-changes/schema-lint-errors/partial-key-in-unique-key"},{"title":"FOREIGN_KEYS_CIRCULAR_DEPENDENCY schema lint error","sidebarTitle":"FOREIGN_KEYS_CIRCULAR_DEPENDENCY","href":"/vitess/schema-changes/schema-lint-errors/foreign-keys-circular-dependency"},{"title":"FOREIGN_KEYS_NONEXISTENT_TABLE schema lint error","sidebarTitle":"FOREIGN_KEYS_NONEXISTENT_TABLE","href":"/vitess/schema-changes/schema-lint-errors/foreign-keys-nonexistent-table"},{"title":"FOREIGN_KEYS_REFERENCED_VIEW schema lint error","sidebarTitle":"FOREIGN_KEYS_REFERENCED_VIEW","href":"/vitess/schema-changes/schema-lint-errors/foreign-keys-referenced-view"},{"title":"FOREIGN_KEYS_UNRESOLVED schema lint error","sidebarTitle":"FOREIGN_KEYS_UNRESOLVED","href":"/vitess/schema-changes/schema-lint-errors/foreign-keys-unresolved"},{"title":"INVALID_ROUTING_RULES schema lint error","sidebarTitle":"INVALID_ROUTING_RULES","href":"/vitess/schema-changes/schema-lint-errors/invalid-routing-rules"}]},{"group":"Schema changes","pages":[{"title":"How to make different types of schema changes","description":"Your database has to grow and change with your application and product.","href":"/vitess/schema-changes/how-to-make-different-types-of-schema-changes"},{"title":"PlanetScale GitHub Actions","sidebarTitle":"Automating with GitHub Actions","href":"/vitess/integrations/github-actions"},{"title":"Handling table and column renames","description":null,"href":"/vitess/schema-changes/handling-table-and-column-renames"},{"title":"Online DDL change unique keys","sidebarTitle":"Changing primary and unique keys","href":"/vitess/schema-changes/onlineddl-change-unique-keys"}]}]},{"group":"Monitoring","pages":[{"group":"PlanetScale Insights","pages":[{"title":"Query Insights","href":"/vitess/monitoring/query-insights"},{"title":"Inspect live Vitess connections","sidebarTitle":"Connections","href":"/vitess/monitoring/connections"},{"title":"Tags","href":"/vitess/monitoring/query-tags"},{"title":"Anomalies","sidebarTitle":"Anomalies","href":"/vitess/monitoring/anomalies"},{"title":"Errors","sidebarTitle":"Errors","href":"/vitess/monitoring/errors"},{"title":"Schema recommendations","sidebarTitle":"Schema recommendations","href":"/vitess/monitoring/schema-recommendations"}]},{"group":"Prometheus","pages":[{"title":"Prometheus","sidebarTitle":"Connecting Prometheus","href":"/vitess/integrations/prometheus"},{"title":"Grafana Dashboard for PlanetScale Branches","sidebarTitle":"Visualizing in Grafana","href":"/vitess/tutorials/prometheus-metrics-grafana"},{"title":"Sending Prometheus Metrics to Datadog","sidebarTitle":"Collecting in the Datadog Agent","href":"/vitess/tutorials/prometheus-metrics-datadog"},{"title":"Sending Prometheus Metrics to New Relic","sidebarTitle":"Forwarding metrics to New Relic","href":"/vitess/tutorials/prometheus-metrics-newrelic"},{"title":"Prometheus metrics","sidebarTitle":"Metrics List","href":"/vitess/integrations/prometheus-metrics"}]},{"group":"Integrations","pages":[{"title":"Datadog integration","sidebarTitle":"Datadog (legacy)","href":"/vitess/integrations/datadog"}]},{"group":"Database auditing","pages":[{"title":"Audit log","href":"/vitess/audit-log"}]}]},{"group":"Backups","pages":[{"title":"Back up and restore","href":"/vitess/backups"}]},{"group":"Scaling","pages":[{"title":"Cluster sizing","sidebarTitle":"Cluster sizing","href":"/vitess/scaling/cluster-sizing"},{"title":"Cluster configuration","href":"/vitess/scaling/cluster-configuration"},{"title":"Per-shard sizing","href":"/vitess/cluster-configuration/per-shard-sizing"},{"title":"Database replicas","sidebarTitle":"Replicas","href":"/vitess/scaling/replicas"},{"title":"Read-only regions","href":"/vitess/scaling/read-only-regions"},{"title":"Vitess system limits","href":"/vitess/scaling/planetscale-system-limits"},{"title":"VTGates","href":"/vitess/scaling/vtgates"},{"title":"Deleting a database","sidebarTitle":"Deleting a database","href":"/vitess/delete-a-database"}]},{"group":"Sharding","pages":[{"group":"Overview","pages":[{"title":"Sharding with PlanetScale","href":"/vitess/sharding"},{"title":"What are workflows?","sidebarTitle":"Workflows","href":"/vitess/scaling/workflows"}]},{"group":"Guides","pages":[{"title":"Shard existing tables with MoveTables","sidebarTitle":"Sharding quickstart","href":"/vitess/sharding/sharding-quickstart"},{"title":"Change the number of shards with MoveTables","sidebarTitle":"Modifying the number of shards","href":"/vitess/sharding/sharding-a-sharded-keyspace"},{"title":"Sharding new tables","sidebarTitle":"Sharding new tables","href":"/vitess/sharding/sharding-new-tables"},{"title":"Avoiding cross-shard queries","href":"/vitess/sharding/avoiding-cross-shard-queries"},{"title":"Targeting the correct keyspace","sidebarTitle":"Keyspace targeting for ORMs and frameworks","href":"/vitess/sharding/targeting-correct-keyspace"},{"title":"Sequence Tables","sidebarTitle":"Creating sequence tables","href":"/vitess/sharding/sequence-tables"},{"title":"Pre-sharding checklist","sidebarTitle":"Pre-sharding checklist","href":"/vitess/sharding/pre-sharding-checklist"}]},{"group":"Concepts","pages":[{"title":"VSchema","sidebarTitle":"VSchema","href":"/vitess/sharding/vschema"},{"title":"ALTER VSCHEMA syntax reference","sidebarTitle":"ALTER VSCHEMA syntax","href":"/vitess/sharding/alter-vschema"},{"title":"Vindexes","sidebarTitle":"Vindexes","href":"/vitess/sharding/vindexes"},{"title":"What is a keyspace","sidebarTitle":"Keyspace","href":"/vitess/sharding/keyspaces"},{"title":"Sharding workflow state reference","sidebarTitle":"Sharding workflow state reference","href":"/vitess/sharding/sharding-workflow-state-reference"}]}]},{"group":"Vectors","pages":[{"title":"Vector search and storage","sidebarTitle":"Vectors overview","href":"/vitess/vectors"},{"title":"Vector database terminology and concepts","sidebarTitle":"Concepts and terminology","href":"/vitess/vectors/terminology-and-concepts"},{"title":"Common use cases for Vector search","sidebarTitle":"Use cases","href":"/vitess/vectors/use-cases"},{"title":"Vectors with an ORM","sidebarTitle":"Using with an ORM","href":"/vitess/vectors/using-with-an-orm"},{"title":"Vector type and index reference","sidebarTitle":"Reference","href":"/vitess/vectors/reference"}]},{"group":"Security","pages":[{"title":"Security and compliance","sidebarTitle":"Overview","href":"/security"},{"title":"Vulnerability disclosure","href":"/security/vulnerability-disclosure"},{"group":"Database security","pages":[{"title":"Connection strings","href":"/vitess/security/connection-strings"},{"title":"Connecting to PlanetScale securely","sidebarTitle":"Secure connections","href":"/vitess/connecting/secure-connections"},{"title":"Password roles","href":"/vitess/security/password-roles"}]},{"group":"Account access","pages":[{"title":"Authentication methods","href":"/security/authentication-methods"},{"title":"Multi-factor authentication","href":"/security/multi-factor-authentication"},{"title":"Account password security","href":"/security/account-password-security"},{"title":"Security log","href":"/security/security-log"}]},{"group":"Organization access","pages":[{"title":"Access control","href":"/security/access-control"},{"title":"Audit log","href":"/security/audit-log"},{"title":"Teams","sidebarTitle":"Teams","href":"/security/teams"},{"title":"Single sign-on","href":"/security/sso"}]}]},{"group":"Troubleshooting","pages":[{"title":"MySQL compatibility","sidebarTitle":"MySQL compatibility","href":"/vitess/troubleshooting/mysql-compatibility"},{"title":"Vitess system limits","href":"/vitess/troubleshooting/planetscale-system-limits"},{"title":"PlanetScale database error reference","sidebarTitle":"Errors reference","href":"/vitess/troubleshooting/errors"},{"title":"Out of memory (OOM)","href":"/vitess/troubleshooting/out-of-memory"}]}]},{"group":"Integrations","pages":[{"group":"Development","pages":[{"title":"Cloudflare Workers database integration","sidebarTitle":"Cloudflare Workers","href":"/vitess/integrations/cloudflare-workers"},{"title":"Netlify","url":"https://docs.netlify.com/extend/install-and-use/setup-guides/planetscale-integration/","href":"/vitess/integrations/netlify"},{"title":"Deploy to Vercel","sidebarTitle":"Vercel","href":"/vitess/tutorials/deploy-to-vercel"},{"title":"AWS Lambda connection strings","sidebarTitle":"AWS Lambda","href":"/vitess/tutorials/aws-lambda-connection-strings"}]},{"group":"ETL","pages":[{"title":"PlanetScale Connect","sidebarTitle":"Overview","href":"/vitess/etl"},{"title":"Airbyte integration","sidebarTitle":"Airbyte","href":"/vitess/integrations/airbyte"},{"title":"Artie integration","sidebarTitle":"Artie","href":"/vitess/integrations/artie"},{"title":"Fivetran integration","sidebarTitle":"Fivetran","href":"/vitess/integrations/fivetran"},{"title":"Hightouch integration","sidebarTitle":"Hightouch","href":"/vitess/integrations/hightouch"},{"title":"Stitch integration","sidebarTitle":"Stitch","href":"/vitess/integrations/stitch"},{"group":"Debezium","pages":[{"title":"Debezium connector for PlanetScale","sidebarTitle":"Debezium","href":"/vitess/integrations/debezium"},{"title":"Debezium connector on Confluent Cloud","sidebarTitle":"Confluent Cloud","href":"/vitess/integrations/debezium-confluent"}]}]},{"group":"Monitoring","pages":[{"title":"Prometheus","sidebarTitle":"Prometheus","href":"/vitess/tutorials/prometheus"},{"title":"Grafana Dashboard for PlanetScale Branches","sidebarTitle":"Grafana","href":"/vitess/monitoring/prometheus-metrics-grafana"},{"title":"Sending Prometheus Metrics to Datadog","sidebarTitle":"Datadog Agent","href":"/vitess/monitoring/prometheus-metrics-datadog"},{"title":"Sending Prometheus Metrics to New Relic","sidebarTitle":"New Relic","href":"/vitess/monitoring/prometheus-metrics-newrelic"},{"title":"Datadog integration","sidebarTitle":"Datadog (legacy)","href":"/vitess/monitoring/datadog"}]},{"group":"Billing","pages":[{"title":"Vantage integration","sidebarTitle":"Vantage","href":"/vitess/integrations/vantage"}]}]},{"group":"Guides","pages":[{"group":"Frameworks and ORMs","pages":[{"title":"Connect a Django application to PlanetScale","sidebarTitle":"Django","href":"/vitess/tutorials/connect-django-app"},{"group":"Golang","pages":[{"title":"Connect a Go application to PlanetScale","sidebarTitle":"Go quickstart","href":"/vitess/tutorials/connect-go-app"},{"title":"Connect a Go application using GORM to PlanetScale","sidebarTitle":"Gorm","href":"/vitess/tutorials/connect-go-gorm-app"}]},{"group":"Next.js","pages":[{"title":"Connect a Next.js application to PlanetScale","sidebarTitle":"Next.js quickstart","href":"/vitess/tutorials/connect-nextjs-app"},{"title":"Next.js and PlanetScale Netlify template tutorial","sidebarTitle":"Next.js and Netlify template","href":"/vitess/tutorials/nextjs-planetscale-netlify-template"},{"title":"Deploy to Vercel","sidebarTitle":"Deploy to Vercel","href":"/vitess/tutorials/nextjs-deploy-to-vercel"},{"title":"Deploy to Netlify","sidebarTitle":"Deploy to Netlify","href":"/vitess/tutorials/deploy-to-netlify"}]},{"title":"Connect a Node.js application to PlanetScale","sidebarTitle":"Node.js","href":"/vitess/tutorials/connect-nodejs-app"},{"group":"PHP","pages":[{"title":"Connect a PHP application to PlanetScale","sidebarTitle":"PHP quickstart","href":"/vitess/tutorials/connect-php-app"},{"title":"Connect a Laravel application to PlanetScale","sidebarTitle":"Laravel quickstart","href":"/vitess/tutorials/connect-laravel-app"},{"title":"Connect a Symfony application to PlanetScale","sidebarTitle":"Symfony quickstart","href":"/vitess/tutorials/connect-symfony-app"}]},{"group":"Prisma","pages":[{"title":"Using PlanetScale with Prisma","sidebarTitle":"Prisma guide","href":"/vitess/tutorials/using-planetscale-with-prisma"},{"title":"Automatic Prisma migrations","sidebarTitle":"Automatic Prisma migrations","href":"/vitess/tutorials/automatic-prisma-migrations"},{"title":"Using the PlanetScale serverless driver with Prisma","sidebarTitle":"Serverless driver with Prisma","href":"/vitess/tutorials/planetscale-serverless-driver-prisma-example"},{"title":"Prisma best practices","href":"/vitess/tutorials/prisma-best-practices"}]},{"group":"Ruby on Rails","pages":[{"title":"Connect a Rails application to PlanetScale","sidebarTitle":"Ruby on Rails quickstart","href":"/vitess/tutorials/connect-rails-app"},{"title":"Automatic Rails migrations","sidebarTitle":"Automatic Rails migrations","href":"/vitess/tutorials/automatic-rails-migrations"}]}]},{"group":"Deployments","pages":[{"title":"Deploy to Netlify","sidebarTitle":"Deploy to Netlify","href":"/vitess/tutorials/deployments/deploy-to-netlify"},{"title":"Deploy to Vercel","href":"/vitess/tutorials/deployments/deploy-to-vercel"},{"title":"Next.js and PlanetScale Netlify template tutorial","sidebarTitle":"Next.js and Netlify template","href":"/vitess/tutorials/deployments/nextjs-planetscale-netlify-template"},{"title":"Deploy a Django app to Heroku","href":"/vitess/tutorials/deploy-a-django-app-to-heroku"}]},{"group":"Monitoring","pages":[{"title":"Grafana Dashboard for PlanetScale Branches","sidebarTitle":"Visualizing in Grafana","href":"/vitess/guides/prometheus-metrics-grafana"},{"title":"Sending Prometheus Metrics to Datadog","sidebarTitle":"Sending Prometheus Metrics to Datadog","href":"/vitess/guides/prometheus-metrics-datadog"},{"title":"Sending Prometheus Metrics to New Relic","sidebarTitle":"Sending Prometheus Metrics to New Relic","href":"/vitess/guides/prometheus-metrics-newrelic"}]},{"group":"Serverless JavaScript driver","pages":[{"title":"PlanetScale serverless driver for JavaScript","sidebarTitle":"Using the serverless driver","href":"/vitess/tutorials/planetscale-serverless-driver"},{"title":"Node.js example using the PlanetScale serverless driver","sidebarTitle":"Node.js example","href":"/vitess/tutorials/planetscale-serverless-driver-node-example"},{"title":"Using the PlanetScale serverless driver with Prisma","sidebarTitle":"Prisma example","href":"/vitess/tutorials/prisma-example"}]},{"group":"MySQL","pages":[{"title":"Operating without foreign key constraints","sidebarTitle":"Operating without foreign key constraints","href":"/vitess/operating-without-foreign-key-constraints"},{"title":"How to make different types of schema changes","sidebarTitle":"Performing different types of schema changes","href":"/vitess/how-to-make-different-types-of-schema-changes"},{"title":"How Online Schema Change tools work","sidebarTitle":"How online schema change tools work","href":"/vitess/schema-changes/how-online-schema-change-tools-work"},{"title":"Online DDL change unique keys","sidebarTitle":"OnlineDDL","href":"/vitess/onlineddl-change-unique-keys"},{"title":"Strategies for maintaining referential integrity","sidebarTitle":"Changing unique keys","href":"/vitess/strategies-for-maintaining-referential-integrity"},{"title":"Handling table and column renames","sidebarTitle":"Renaming columns and tables","href":"/vitess/handling-table-and-column-renames"},{"title":"Comparison of Online Schema Change tools","sidebarTitle":"Online schema change tool comparison","href":"/vitess/schema-changes/online-schema-change-tools-comparison"}]}]}]},{"tab":"Neki","pages":[{"title":"Neki","href":"/neki"}]},{"tab":"Postgres","pages":[{"title":"Postgres","href":"/postgres"}]},{"tab":"API Reference","pages":[{"title":"API Reference","href":"/api/reference/getting-started-with-planetscale-api"}]},{"tab":"CLI Reference","pages":[{"title":"CLI Reference","href":"/cli"}]}]},"title":"PlanetScale GitHub Actions - PlanetScale","buildId":"dpl_AUojGTPodKNPTVaxVPcxnNvkSVqo","deploymentId":"dpl_AUojGTPodKNPTVaxVPcxnNvkSVqo","dynamics":[],"chunks":[]}