Skip to content

Commit

Permalink
Merge pull request #43 from tanhongit/develop
Browse files Browse the repository at this point in the history
Adjust the owner instead of setting full permissions to the json file
  • Loading branch information
mytruong-z authored Feb 26, 2024
2 parents 4d68817 + a0421e1 commit fc35ada
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .github/workflows/setup_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,8 @@ jobs:
- name: Run tests
run: |
composer validate --strict
- name: Run pest tests
run: |
bash install.sh
composer test
7 changes: 6 additions & 1 deletion install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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!"

0 comments on commit fc35ada

Please sign in to comment.