Skip to content

Commit

Permalink
chore: 네이밍 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
BaeJinho4028 committed Nov 25, 2024
1 parent 69e1cb6 commit 1ffd477
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/flyway-check-dangerous-sql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,22 +22,22 @@ jobs:
${{ github.event.pull_request.base.sha }} \
${{ github.event.pull_request.head.sha }}
)
NON_FLYWAY_CHANGES=$(
NON_FLYWAY_FILES_CHANGES=$(
echo "$CHANGED_FILES" | grep -v '^src/main/resources/db.migration/' || true
)
SQL_COMMANDS=$(
DANGEROUS_SQL_COMMANDS=$(
git diff --unified=0 \
${{ github.event.pull_request.base.sha }} \
${{ github.event.pull_request.head.sha }} \
-- 'src/main/resources/db.migration/**/*.sql' | \
grep -i -wE "^\+.*\b(DROP|TRUNCATE|RENAME|CONSTRAINT|MODIFY|CHANGE)\b" || true
)
if [[ -n "$SQL_COMMANDS" && -n "$NON_FLYWAY_CHANGES" ]]; then
if [[ -n "$DANGEROUS_SQL_COMMANDS" && -n "$NON_FLYWAY_FILES_CHANGES" ]]; then
echo "::error:: Flyway 스크립트에서 위험한 SQL 명령어가 발견되었습니다:"
echo "$SQL_COMMANDS"
echo "$DANGEROUS_SQL_COMMANDS"
echo "::error:: Flyway 디렉토리를 제외하고 변경된 파일이 감지되었습니다:"
echo "$NON_FLYWAY_CHANGES"
echo "$NON_FLYWAY_FILES_CHANGES"
exit 1
fi

0 comments on commit 1ffd477

Please sign in to comment.