Skip to content

Commit 24f9c5a

Browse files
committed
fix pass directory check for github actions
1 parent c2c5115 commit 24f9c5a

File tree

2 files changed

+19
-17
lines changed

2 files changed

+19
-17
lines changed

.github/workflows/main.yml

+11-11
Original file line numberDiff line numberDiff line change
@@ -22,36 +22,36 @@ jobs:
2222
steps:
2323
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
2424
- uses: actions/checkout@v2
25-
25+
2626
- name: Github Actions Azure connection fix
2727
run: |
2828
# Workaround for https://github.com/actions/runner-images/issues/675#issuecomment-1381389712
2929
sudo sed -i 's/azure/us/g' /etc/apt/sources.list
3030
3131
- name: Installing Countly
3232
shell: bash
33-
run: sudo bash ./bin/countly.install.sh
34-
33+
run: sudo bash ./bin/countly.install.sh gh
34+
3535
- name: NodeJS version
3636
shell: bash
3737
run: node --version
38-
38+
3939
- name: NPM version
4040
shell: bash
4141
run: npm --version
42-
42+
4343
- name: Mongo version
4444
shell: bash
4545
run: mongo --version
46-
46+
4747
- name: ShellCheck
4848
shell: bash
4949
run: countly shellcheck
50-
50+
5151
- name: ESLint
5252
shell: bash
5353
run: npx eslint .
54-
54+
5555
- name: DistFiles
5656
shell: bash
5757
run: sudo countly task dist-all
@@ -63,19 +63,19 @@ jobs:
6363
- name: Output API Logs
6464
if: ${{ always() }}
6565
run: cat log/countly-api.log
66-
66+
6767
- name: Output Dashboard Logs
6868
if: ${{ always() }}
6969
run: cat log/countly-dashboard.log
70-
70+
7171
- name: Output MongoDB Logs
7272
if: ${{ always() }}
7373
run: sudo cat /var/log/mongodb/mongod.log
7474

7575
- name: Output Nginx Logs
7676
if: ${{ always() }}
7777
run: sudo cat /var/log/nginx/error.log
78-
78+
7979
- name: Send slack notification
8080
id: slack
8181
if: always()

bin/countly.install.sh

+8-6
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,15 @@ DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
33
DATE=$(date +%Y-%m-%d:%H:%M:%S)
44
totalm=$(free -m | awk '/^Mem:/{print $2}')
55

6-
if [[ "$DIR" = '/root'* ]]; then
7-
echo "You cannot install Countly under /root. Suggested paths: /opt or /usr."
8-
exit 1
9-
elif [[ "$DIR" = '/home'* ]]; then
10-
if ! [[ "$DIR" = '/home/countly'* ]]; then
11-
echo "You cannot install Countly under home directory of any other user. Suggested paths: /opt or /usr."
6+
if ! [[ "$1" = 'gh' ]]; then
7+
if [[ "$DIR" = '/root'* ]]; then
8+
echo "You cannot install Countly under /root. Suggested paths: /opt or /usr."
129
exit 1
10+
elif [[ "$DIR" = '/home'* ]]; then
11+
if ! [[ "$DIR" = '/home/countly'* ]]; then
12+
echo "You cannot install Countly under home directory of any other user. Suggested paths: /opt or /usr."
13+
exit 1
14+
fi
1315
fi
1416
fi
1517

0 commit comments

Comments
 (0)