From 496906c07f23ea8a760bd54c19a9cb1ec852827b Mon Sep 17 00:00:00 2001 From: Tan Nguyen Date: Sun, 25 Feb 2024 21:31:42 +0700 Subject: [PATCH 1/2] add pest test in workflows --- .github/workflows/setup_test.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/setup_test.yml b/.github/workflows/setup_test.yml index 983c9c2..e1a38ed 100644 --- a/.github/workflows/setup_test.yml +++ b/.github/workflows/setup_test.yml @@ -19,3 +19,8 @@ jobs: - name: Run tests run: | composer validate --strict + + - name: Run pest tests + run: | + bash install.sh + composer test From a0421e1f76a8ab8dc7cb88d3cf384646f8eb1fd7 Mon Sep 17 00:00:00 2001 From: Tan Nguyen Date: Sun, 25 Feb 2024 21:52:51 +0700 Subject: [PATCH 2/2] adjust owner instead of setting full permissions for json files --- install.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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!"