GitHub Action
Liquibase Github Action
This repository is being replaced with Liquibase Github Actions which includes full command and parameter coverage. This repository will not receive any future updates. Please update your workflows. Any issues should be reported to the Liquibase GitHub Action Generator repository.
Basic Update
steps:
- uses: actions/checkout@v2
- uses: liquibase/liquibase-github-action@v7
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@v7
with:
operation: 'updateCount'
classpath: 'example/changelogs'
changeLogFile: 'samplechangelog.h2.sql'
username: ${{ secrets.USERNAME }}
password: ${{ secrets.PASSWORD }}
url: ${{ secrets.URL }}
count: 2
operation
is required for every use.
The operation
input expects one of the following:
- update
- updateCount
- tag
- updateToTag
- updateTestingRollback
- rollback
- rollbackCount
- rollbackToDate
- updateSQL
- futureRollbackSQL
- status
- history
- diff
- validate
- 'checks run' (note that the
checks run
command must be wrapped with quotes in yourbuild.yml
because the command has a space in it)
username
, password
, url
, classpath
, changeLogFile
, count
, tag
, date
, referenceUrl
, proLicenseKey
(deprecated in favor of licenseKey
) and hubApiKey
are optional inputs that may be required by some operations.
It is recommended that licenseKey
and hubApiKey
are not stored in plaintext, but rather using a GitHub secret:
licenseKey: ${{ secrets.PRO_LICENSE_KEY }}
The following operations have the subsequent required inputs:
- username
- password
- url
- classpath
- changeLogFile
- count
- databaseChangeLogTableName (optional)
- databaseChangeLogLockTableName (optional)
- username
- password
- url
- tag
- databaseChangeLogTableName (optional)
- databaseChangeLogLockTableName (optional)
- username
- password
- url
- classpath
- changeLogFile
- tag
- databaseChangeLogTableName (optional)
- databaseChangeLogLockTableName (optional)
- username
- password
- url
- classpath
- changeLogFile
- username
- password
- url
- classpath
- changeLogFile
- tag
- databaseChangeLogTableName (optional)
- databaseChangeLogLockTableName (optional)
- username
- password
- url
- classpath
- changeLogFile
- count
- databaseChangeLogTableName (optional)
- databaseChangeLogLockTableName (optional)
- username
- password
- url
- classpath
- changeLogFile
- date
- databaseChangeLogTableName (optional)
- databaseChangeLogLockTableName (optional)
- username
- password
- url
- changeLogFile
- databaseChangeLogTableName (optional)
- databaseChangeLogLockTableName (optional)
- username
- password
- url
- classpath
- changeLogFile
- databaseChangeLogTableName (optional)
- databaseChangeLogLockTableName (optional)
- username
- password
- url
- classpath
- changeLogFile
- databaseChangeLogTableName (optional)
- databaseChangeLogLockTableName (optional)
- username
- password
- url
- referenceUrl
- databaseChangeLogTableName (optional)
- databaseChangeLogLockTableName (optional)
- username
- password
- url
- changeLogFile
- changeLogFile
- checksSettingsFile
It is a good practice to protect your database credentials with Github Secrets
Want to file a bug, contribute some code, or improve documentation? Excellent! Read up on our guidelines for contributing!
We've found that the easiest way to test changes to this GitHub action is to:
-
fork this repo to your personal account
-
create a sample
build.yml
to trigger the action, noting that theuses
line specifies the relative path, which will run the action as specified in your fork (rather than the action that is published by Liquibase)name: Build and Test on: [push, pull_request] jobs: runchecks: name: "Run Liquibase Quality Checks" runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - uses: ./ with: operation: 'checks run' changeLogFile: 'mychangelog.sql' checksSettingsFile: 'liquibasech.conf' proLicenseKey: ${{ secrets.PRO_LICENSE_KEY }}
-
make changes as desired and observe the execution in GitHub