-
Notifications
You must be signed in to change notification settings - Fork 37
37 lines (32 loc) · 1.19 KB
/
verifyMigrations.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
name: Verify migrations
on:
pull_request_target:
branches: [main]
env:
success_message: ":sparkles: Successfully ran migration command! :sparkles:"
jobs:
VerifyMigrations:
runs-on: ubuntu-latest
if: ${{ github.event_name == 'pull_request_target' }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Get changed files in the migrations folder
id: changed-files-specific
uses: tj-actions/[email protected]
with:
files: backend/api/Migrations/**
sha: ${{ github.event.pull_request.head.sha }}
- name: If files changed, check for database success
if: ${{ steps.changed-files-specific.outputs.any_changed == 'true' }}
id: database_comment_search
uses: peter-evans/find-comment@v3
with:
issue-number: ${{ github.event.number }}
body-includes: ${{ env.success_message }}
comment-author: github-actions[bot]
- name: Fail if files changed & no database success (comment not found)
if: |
steps.changed-files-specific.outputs.any_changed == 'true' &&
!steps.database_comment_search.outputs.comment-body
run: exit 1