/
dimamir
/
medusa
Обзор
Документация
Войти
/
dimamir
/
medusa
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
develop
scripts/assert-codegen-build-committed-actions.sh
30 строк
997 B
Patrick
feat(codegen): commit generated client types to codebase (#3492)
16 мар 2023, 18:30
Не верифицирован
16 мар 2023, 18:30
e6e5291
Код
Авторство
О чём код?
#!/bin/bash # Stackoverflow: How do I programmatically determine if there are uncommitted changes? # https://stackoverflow.com/questions/3878624/how-do-i-programmatically-determine-if-there-are-uncommitted-changes IS_CI="${CI:-false}" if [ "$IS_CI" = true ]; then git config --local url."https://github.com/".insteadOf git@github.com: git config --local user.name "Medusajs Bot" git config --local user.email "core@medusa-commerce.com" fi FILE_CHANGES=$(git status --porcelain=v1 | grep 'packages/generated') FILE_CHANGES_COUNT=$(git status --porcelain=v1 | grep 'packages/generated' | wc -l) if [ "$IS_CI" = true ]; then git config --local --unset user.name git config --local --unset user.email git config --local --unset url."https://github.com/".insteadOf fi if [ "$FILE_CHANGES_COUNT" -ne 0 ]; then echo "$FILE_CHANGES" echo "Latest codegen build was not committed. Run 'yarn build' and commit generated files." exit 1 else echo "All has been committed." exit 0 fi