Skip to content

Add CLI and project addition capabilities #10

Add CLI and project addition capabilities

Add CLI and project addition capabilities #10

name: Check Migrations
on:
pull_request:
types: [opened, synchronize]
paths:
- 'src/database/migrations/**'
jobs:
check-migrations:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Check and add comment to PR
uses: actions/github-script@v4
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const { data: comments } = await github.rest.issues.listComments({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
});
const commentExists = comments.some(comment =>
comment.body.includes("It looks like you've made changes to the migrations.")
);
if (!commentExists) {
await github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
body: "It looks like you've made changes to the migrations. Have you run `npm run db:generate-schema` to ensure the updated schemas are included in your PR?"
});
}