Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/premieroctet/prisma-drop-migration-warning
Checks for table or column drops in Prisma migration files in a pull request
https://github.com/premieroctet/prisma-drop-migration-warning
github-actions
Last synced: 2 months ago
JSON representation
Checks for table or column drops in Prisma migration files in a pull request
- Host: GitHub
- URL: https://github.com/premieroctet/prisma-drop-migration-warning
- Owner: premieroctet
- License: isc
- Created: 2024-10-22T16:25:34.000Z (3 months ago)
- Default Branch: main
- Last Pushed: 2024-10-24T13:16:39.000Z (3 months ago)
- Last Synced: 2024-10-25T16:35:24.090Z (3 months ago)
- Topics: github-actions
- Language: JavaScript
- Homepage:
- Size: 834 KB
- Stars: 2
- Watchers: 7
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# Prisma Drop Migration Warning
## Description
**Prisma Drop Migration Warning** is a GitHub Action that checks for table or column drops in Prisma migration files when making a pull request (PR). It helps ensure that potentially unsafe or unwanted changes are caught before they are merged into your main branch.
## Features
- Detects any column / table drops statements in Prisma migration SQL files on a pull request.
- Provides an option to post a warning comment on the pull request if a drop is detected.
- Allows configuration of the main branch to compare against and the path to the Prisma migrations.## Inputs
The following inputs can be configured in your workflow:
| Input | Description | Required | Default |
|-----------------|------------------------------------------------------------------------|----------|---------|
| `main-branch` | The main branch to compare against (e.g., `main`) | Yes | `main` |
| `path` | Path to the Prisma folder (e.g., `prisma`) | Yes | `prisma`|
| `message` | The message to post when a potential drop is detected | No | A default warning message |
| `warning` | Whether to post a warning comment on the PR if a drop is detected | No | `true` |## Usage
To use this action in your GitHub repository, include it in your workflow YAML file as follows:
```yaml
name: Check Prisma Migrationson:
pull_request:
branches:
- mainjobs:
check-migrations:
runs-on: ubuntu-lateststeps:
- name: Checkout repository
uses: actions/checkout@v4with:
fetch-depth: 0 # Fetch full history for all branches to detect changes
ref: ${{ github.event.pull_request.head.sha }} # Check out the current PR- name: Check Prisma migrations
uses: /premieroctet/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Set the GitHub token to access API
with:
main-branch: 'main'
path: 'prisma'
message: 'Potential drop detected in Prisma migration files.'
warning: true
```