Sequelize migrations action

sequelize-migrations-validator

An action for auto recognize new Sequelize files submitted in a pull request. The files will be sent to be analyzed and derive insights at Metis Data platform.
Please use standard Sequelize migrations files that generated by Sequelize cli and exports up/down functions from module.

Usage

Add the following step to your workflow:
- name: Analyze migrations
uses: metis-data/sequelize-migrations-[email protected]
with:
from: ${{ github.event.pull_request.base.sha }}
to: ${{ github.event.pull_request.head.sha }}
github_token: ${{ github.token }}
metis_api_key: <Your Api Key>
migrations_dir: <path/to/migrations/directory>
For example, you can run it in a GitHub Actions workflow job:
on:
pull_request:
types: [opened, reopened, edited, synchronize, ready_for_review]
jobs:
migrations:
name: Analyze new migrations
runs-on: ubuntu-latest
services:
postgres:
image: postgres
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: postgres
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- name: Checkout
uses: actions/[email protected]
with:
fetch-depth: 0
- name: Compare migrations
uses: metis-data/sql-migrations-[email protected]
with:
from: ${{ github.event.pull_request.base.sha }}
to: ${{ github.event.pull_request.head.sha }}
github_token: ${{ github.token }}
metis_api_key: <Your Api Key>
migrations_dir: migrations
Note: For this action to work, you have to set up postgres service that is used to produce the SQL queries.

Parameters

  • from: Base sha to be compared
  • to: Branch sha to be compared with
  • github_token: Auto generated workflow GitHub token
  • metis_api_key: Metis Api Key generated at Metis
  • migrations_dir: Path in your project to Sequelize migrations directory

Issues

If you would like to report a potential issue please use Issues