feat: added slugify migration file creater name and additional check to ensure migration files are not editied in PR

This commit is contained in:
=
2024-06-28 20:33:56 +05:30
parent 7cdc47cd3a
commit 506e86d666
3 changed files with 29 additions and 5 deletions

View File

@@ -0,0 +1,25 @@
name: Check migration file edited
on:
pull_request:
types: [opened, synchronize]
paths:
- 'backend/src/db/migrations/**'
jobs:
rename:
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Check any migration files are modified, renamed or duplicated.
run: |
git diff --name-status HEAD^ HEAD backend/src/db/migrations | grep '^M\|^R\|^C' || true | cut -f2 | xargs -r -n1 basename > edited_files.txt
if [ -s edited_files.txt ]; then
echo "Migration files has been edited"
cat edited_files.txt
exit 1
fi