Skip to content

Fix inspection frequency backend crash #520

Fix inspection frequency backend crash

Fix inspection frequency backend crash #520

name: Notify possible migration changes
on:
pull_request_target:
branches: [main]
paths: [backend/api/Database/**]
env:
message: |
:bell: Changes in database folder detected :bell:
Do these changes require **adding new migrations**? :thinking: In that case follow [these steps](https://github.com/equinor/flotilla/tree/main/backend#Database-model-and-EF-Core).
If you are uncertain, ask a database admin on the team :smile:
jobs:
Notify_Possible_Migration:
runs-on: ubuntu-latest
permissions:
pull-requests: write
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Get changed files in the migrations folder
id: changed_files
uses: tj-actions/[email protected]
with:
files: backend/api/Migrations/**
sha: ${{ github.event.pull_request.head.sha }}
- name: If no migrations, check for previous comment
if: ${{ steps.changed_files.outputs.any_changed != 'true' }}
id: notify_comment_search
uses: peter-evans/find-comment@v2
with:
issue-number: ${{ github.event.number }}
body-includes: ${{ env.message }}
- name: Add comment if no migrations and no comment exists
if: |
!steps.notify_comment_search.outputs.comment-body &&
steps.changed_files.outputs.any_changed != 'true'
uses: peter-evans/create-or-update-comment@v2
with:
token: ${{ secrets.GITHUB_TOKEN }}
issue-number: ${{ github.event.number }}
body: ${{ env.message }}