Skip to content
You're viewing an older version of this GitHub Action. Do you want to see the latest version instead?
database

GitHub Action

Liquibase Github Action

v2

Liquibase Github Action

database

Liquibase Github Action

Validate, Prepare and Execute Liquibase CLI

Installation

Copy and paste the following snippet into your .yml file.

              

- name: Liquibase Github Action

uses: liquibase/liquibase-github-action@v2

Learn more about this action in liquibase/liquibase-github-action

Choose a version

liquibase-github-action

Official Github Action to run Liquibase in your pipeline.

Usage

Basic Update

steps:
  - uses: actions/checkout@v2
  - uses: liquibase/liquibase-github-action@v1
    with:
      operation: 'update'
      classpath: 'example/changelogs'
      changeLogFile: 'samplechangelog.h2.sql'
      username: ${{ secrets.USERNAME }}
      password: ${{ secrets.PASSWORD }}
      url: ${{ secrets.URL }}

Optional Parameter Example:

steps:
  - uses: actions/checkout@v2
  - uses: liquibase/liquibase-github-action@v1
    with:
      operation: 'updateCount'
      classpath: 'example/changelogs'
      changeLogFile: 'samplechangelog.h2.sql'
      username: ${{ secrets.USERNAME }}
      password: ${{ secrets.PASSWORD }}
      url: ${{ secrets.URL }}
      count: 2

Required Inputs

operation, username, password, and url are required for every use.

The operation input expects one of the following:

  • update
  • updateCount
  • tag
  • updateToTag
  • rollback
  • rollbackCount
  • rollbackToDate
  • updateSQL
  • futureRollbackSQL
  • status
  • history
  • diff

Optional Inputs

classpath, changeLogFile, count, tag, date, and referenceUrl are optional inputs that may be required by some operations. The following operations have the subsequent required inputs:

updateCount

  • classpath
  • changeLogFile
  • count

tag

  • tag

updateToTag

  • classpath
  • changeLogFile
  • tag

rollback

  • classpath
  • changeLogFile
  • tag

rollbackCount

  • classpath
  • changeLogFile
  • count

rollbackToDate

  • classpath
  • changeLogFile
  • date

updateSQL

  • changeLogFile

futureRollbackSQL

  • classpath
  • changeLogFile

status

  • classpath
  • changeLogFile

diff

  • referenceUrl

Secrets

It is a good practice to protect your database credentials with Github Secrets

Want to help?

Want to file a bug, contribute some code, or improve documentation? Excellent! Read up on our guidelines for contributing!