https://github.com/guibranco/github-database-migration-action
🎲 :octocat: A GitHub action to manage databaseversioned migrations
https://github.com/guibranco/github-database-migration-action
database gh-actions github-actions manage-database migration
Last synced: 2 months ago
JSON representation
🎲 :octocat: A GitHub action to manage databaseversioned migrations
- Host: GitHub
- URL: https://github.com/guibranco/github-database-migration-action
- Owner: guibranco
- Created: 2024-03-21T22:39:59.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-07-10T23:03:43.000Z (3 months ago)
- Last Synced: 2025-07-11T05:17:46.620Z (3 months ago)
- Topics: database, gh-actions, github-actions, manage-database, migration
- Language: Dockerfile
- Homepage: http://guilherme.stracini.com.br/github-database-migration-action/
- Size: 56.6 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# GitHub database migration action
[](https://github.com/guibranco/github-database-migration-action "shields.io")
[](https://github.com/guibranco/github-database-migration-action "shields.io")
[](https://github.com/guibranco/github-database-migration-action "shields.io")
[](https://github.com/guibranco/github-database-migration-action "shields.io")
[](https://wakatime.com/badge/github/guibranco/github-database-migration-action)🎲 :octocat: A GitHub Action to manage versioned database migrations across multiple database drivers.
## Usage
### Parameters
* `OPERATION` (required)
The operation to be executed (one of: `dry-run`, `migrate`, `check`, or `integrity`)
* `DRIVER` (required)
The driver to use (one of: `mysql`, `mariadb`, `postgresql`, `mssql` or `oracle11g`)
* `HOST` (required)
The database host address (domain or IPv4).
* `USER` (required)
The username to connect to the database host.
* `DATABASE` (required)
The database name.
* `INTEGRITY_COMMANDS_FILE` (optional)
When the `OPERATION` is `integrity`, this parameter receives the file with a list (one per line) of commands to run and validate the presence of data in the database.### Environment variables
* `DATABASE_PWD` (optional)
The password to connect to the database host. Set as an environment variable to keep it secure.### Outputs
None.
## Example
```yml
name: "test"
on:
pull_request:
push:
branches:
- mainjobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Run the action
uses: guibranco/github-database-migration-action@latest
env:
DATABASE_PWD: ${{ secrets.DATABASE_PWD }} # Pass the password as an environment variable to keep it secret.
with:
OPERATION: migrate
DRIVER: mysql
HOST: 127.0.0.1
USER: test
DATABASE: test
```