Skip to content

Commit 9045ad8

Browse files
achrinzasamarpanB
authored andcommitted
ci: hard code db credentials
To fix Github Actions secrets access restriction for PRs originating from forks. Signed-off-by: Rifa Achrinza <[email protected]>
1 parent febee69 commit 9045ad8

File tree

2 files changed

+7
-11
lines changed

2 files changed

+7
-11
lines changed

.github/workflows/ci.yml

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,13 @@ on:
66
# The branches below must be a subset of the branches above
77
branches: [master]
88

9-
env:
10-
CI: true
11-
129
jobs:
1310
build:
1411
runs-on: ubuntu-22.04
12+
env:
13+
MYSQL_HOST: '127.0.0.1'
14+
MYSQL_USER: myUser
15+
MYSQL_PASSWORD: myPass
1516
strategy:
1617
matrix:
1718
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
@@ -26,17 +27,12 @@ jobs:
2627
with:
2728
mysql-version: 8.0
2829
- run: |
29-
sudo mysql -e "CREATE USER '${{ secrets.MYSQL_USER }}'@'localhost' IDENTIFIED BY '${{ secrets.MYSQL_PASSWORD }}'"
30-
sudo mysql -u root -e "GRANT ALL PRIVILEGES ON *.* TO '${{ secrets.MYSQL_USER }}'@'localhost'"
31-
sudo mysql -u root -e "ALTER USER '${{ secrets.MYSQL_USER }}'@'localhost' IDENTIFIED WITH mysql_native_password by '${{ secrets.MYSQL_PASSWORD }}'"
30+
sudo mysql -e "CREATE USER '$MYSQL_USER'@'localhost' IDENTIFIED BY '$MYSQL_PASSWORD'"
31+
sudo mysql -u root -e "GRANT ALL PRIVILEGES ON *.* TO '$MYSQL_USER'@'localhost'"
32+
sudo mysql -u root -e "ALTER USER '$MYSQL_USER'@'localhost' IDENTIFIED WITH mysql_native_password by '$MYSQL_PASSWORD'"
3233
sudo mysql -u root -e "FLUSH PRIVILEGES"
3334
- run: npm install
3435
- run: npm test
35-
env:
36-
MYSQL_HOST: '127.0.0.1'
37-
MYSQL_USER: ${{ secrets.MYSQL_USER }}
38-
MYSQL_PASSWORD: ${{ secrets.MYSQL_PASSWORD }}
39-
CI: true
4036
code-lint:
4137
name: Code Lint
4238
runs-on: ubuntu-latest

.setup.sh.swp

16 KB
Binary file not shown.

0 commit comments

Comments
 (0)