diff --git a/.github/workflows/setup_test.yml b/.github/workflows/setup_test.yml index 002aa0f..8ee2ca9 100644 --- a/.github/workflows/setup_test.yml +++ b/.github/workflows/setup_test.yml @@ -30,3 +30,8 @@ jobs: - name: Run tests run: | composer validate --strict + + - name: Run pest tests + run: | + bash install.sh + composer test diff --git a/install.sh b/install.sh index 9cf4c58..ace75f2 100644 --- a/install.sh +++ b/install.sh @@ -18,7 +18,12 @@ for file in "${json_files[@]}"; do done if [[ "$(uname -s -r)" == *"Linux"* && "$(cat /etc/os-release)" == *"Ubuntu"* ]]; then - chmod 777 storage/json/tgn/*.json + # shellcheck disable=SC2196 + OWNER=$(ps aux | egrep '(apache|httpd|nginx)' | grep -v root | head -n1 | awk '{print $1}') + if [ -z "$OWNER" ]; then + OWNER=$(whoami) + fi + sudo chown -R "$OWNER":"$OWNER" storage/json/tgn fi echo "Telegram Git Notifier config files are ready!"