{"id":21659908,"url":"https://github.com/planetscale/create-branch-action","last_synced_at":"2025-07-17T23:30:26.833Z","repository":{"id":164455499,"uuid":"611286190","full_name":"planetscale/create-branch-action","owner":"planetscale","description":"A GitHub Action that creates a new branch of your PlanetScale database","archived":true,"fork":false,"pushed_at":"2024-02-23T16:39:26.000Z","size":215,"stargazers_count":12,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-07-13T07:00:14.979Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/planetscale.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"license.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-03-08T14:10:53.000Z","updated_at":"2024-02-23T16:39:51.000Z","dependencies_parsed_at":null,"dependency_job_id":"9edf801c-ce01-4eba-9003-7dd49c7ee3b5","html_url":"https://github.com/planetscale/create-branch-action","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/planetscale/create-branch-action","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/planetscale%2Fcreate-branch-action","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/planetscale%2Fcreate-branch-action/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/planetscale%2Fcreate-branch-action/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/planetscale%2Fcreate-branch-action/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/planetscale","download_url":"https://codeload.github.com/planetscale/create-branch-action/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/planetscale%2Fcreate-branch-action/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265678448,"owners_count":23810114,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-25T09:31:52.533Z","updated_at":"2025-07-17T23:30:26.323Z","avatar_url":"https://github.com/planetscale.png","language":"Shell","funding_links":[],"categories":["Shell"],"sub_categories":[],"readme":"**:warning: :warning:**\n\n**This Action has been replaced by [`setup-pscale-action`](https://github.com/planetscale/setup-pscale-action). Which is even faster! [Please see an example here](https://planetscale.com/docs/devops/github-actions#create-a-planetscale-branch).**\n\n**:warning: :warning:**\n\n\n### Create Database Branch Action\n\nThis GitHub Action can be used within your workflows to create new branches of your PlanetScale database.\n\n### Prerequisites\n\nBefore you can use this Action, you'll need to configure a service token that has permission to create branches on your database. Refer to our docs on [how to create a service token](https://planetscale.com/docs/concepts/service-tokens) for more details. Once the service token has been created, the following repository secrets must also be set:\n\n- `PLANETSCALE_SERVICE_TOKEN_ID`\n- `PLANETSCALE_SERVICE_TOKEN`\n\nThese values will be used to authenticate to the PlanetScale service.\n\n## Example\n\nThe following example will create a branch on the `recipes_db` database when a pull request is opened. The new branch will be named `mynewbranch` and will be created from the `main` branch.\n\n```yml\nname: Create a branch\non:\n  pull_request:\n    types: [opened]\n\njobs:\n  create_a_branch:\n    runs-on: ubuntu-latest\n    steps:\n      - name: checkout\n        uses: actions/checkout@v3\n      - name: Create a branch\n        uses: planetscale/create-branch-action@v4\n        id: create_branch\n        with:\n          org_name: bmorrison-ps\n          database_name: recipes_db\n          branch_name: mynewbranch\n          from: main\n        env:\n          PLANETSCALE_SERVICE_TOKEN_ID: ${{ secrets.PLANETSCALE_SERVICE_TOKEN_ID }}\n          PLANETSCALE_SERVICE_TOKEN: ${{ secrets.PLANETSCALE_SERVICE_TOKEN }}\n```\n\n## Input variables\n\n**Required**\n\n- `org_name` - The name of the PlanetScale organization.\n- `database_name` - The name of the database to create the branch on.\n- `branch_name` - The name of the new branch.\n\n**Optional**\n\n- `from` - The name of the branch that the new branch will be created from. Defaults to the branch defined in your database settings.\n- `restore` - The ID of the backup that will be restored to the new branch. If not set, no backup will be restored.\n- `region` - The region to create the new branch in. Defaults to the region where the `from` branch currently is.\n- `wait` - If this value is set to \"true\", the action will ensure that the branch is created before exiting. If not, the action will exit immediately once the PlanetScale service has received the command to create the branch.\n- `check_exists` - If set to \"true\", the action won't create the branch if it already exists.\n- `seed_data` - Set to \"true\", to enable seed data from the latest backup using Data Branching™.\\*\n\n\\* The Data Branching™ feature is not available on all plans. More details can be found here: [PlanetScale plans](https://planetscale.com/docs/concepts/planetscale-plans).\n\n## Outputs\n\nThis Action has no output variables.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fplanetscale%2Fcreate-branch-action","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fplanetscale%2Fcreate-branch-action","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fplanetscale%2Fcreate-branch-action/lists"}