GithubHelp home page GithubHelp logo

vinlock / create-branch-password-action Goto Github PK

View Code? Open in Web Editor NEW

This project forked from planetscale/create-branch-password-action

0.0 1.0 0.0 17 KB

A GitHub Action that creates a new password for your PlanetScale database branch

License: Apache License 2.0

Shell 60.70% Dockerfile 39.30%

create-branch-password-action's Introduction

Create Database Password Action

This GitHub Action can be used within your workflows to create new passwords for your PlanetScale database.

Prerequisites

Before 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 for more details. Once the service token has been created, the following repository secrets must also be set:

  • PLANETSCALE_SERVICE_TOKEN_ID
  • PLANETSCALE_SERVICE_TOKEN

These values will be used to authenticate to the PlanetScale service.

Example

The following example will create a new password for the recipes_db database when a pull request is opened. It will also print the credentials that were created during the process.

name: Create a branch
on:
  pull_request:
    types: [opened]

jobs:
  create_a_branch:
    runs-on: ubuntu-latest
    steps:
      - name: checkout
        uses: actions/checkout@v3
      - name: Create a password
        uses: planetscale/create-branch-password-action@v3
        id: create_password
        with:
          org_name: bmorrison-ps
          database_name: recipes_db
          branch_name: main
          name: mynewpassword
        env:
          PLANETSCALE_SERVICE_TOKEN_ID: ${{ secrets.PLANETSCALE_SERVICE_TOKEN_ID }}
          PLANETSCALE_SERVICE_TOKEN: ${{ secrets.PLANETSCALE_SERVICE_TOKEN }}
      - name: Get the new credentials
        run: |
          echo "Hostname: ${{ steps.create_password.outputs.hostname }}" \
          echo "Username: ${{ steps.create_password.outputs.username }}" \
          echo "Password: ${{ steps.create_password.outputs.password }}"

Input variables

Required

  • org_name - The name of the PlanetScale organization.
  • database_name - The name of the database to create the branch on.
  • branch_name - The name of the new branch.
  • name - The name of the password.

Optional

  • role - The role of the password. Allowed values are reader, writer, readerwriter, or admin. Defaults to admin.

Outputs

  • username - The username to use for connecting to the branch.
  • password - The password to use for connecting to the branch.
  • hostname - The hostname for the branch.

create-branch-password-action's People

Contributors

bmorrisondev avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.