From cb6526da26b11e3c5ddb1e09cbfe1f97e6cd9fd9 Mon Sep 17 00:00:00 2001 From: Rifa Achrinza <25147899+achrinza@users.noreply.github.com> Date: Wed, 15 Nov 2023 22:34:40 +0800 Subject: [PATCH] ci: hard code db credentials To fix Github Actions secrets access restriction for PRs originating from forks. Signed-off-by: Rifa Achrinza <25147899+achrinza@users.noreply.github.com> --- .github/workflows/ci.yml | 18 +++++++----------- .setup.sh.swp | Bin 0 -> 16384 bytes 2 files changed, 7 insertions(+), 11 deletions(-) create mode 100644 .setup.sh.swp diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 98a7c8a5..b2338e99 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -6,12 +6,13 @@ on: # The branches below must be a subset of the branches above branches: [master] -env: - CI: true - jobs: build: runs-on: ubuntu-22.04 + env: + MYSQL_HOST: '127.0.0.1' + MYSQL_USER: myUser + MYSQL_PASSWORD: myPass strategy: matrix: # See supported Node.js release schedule at https://nodejs.org/en/about/releases/ @@ -26,17 +27,12 @@ jobs: with: mysql-version: 8.0 - run: | - sudo mysql -e "CREATE USER '${{ secrets.MYSQL_USER }}'@'localhost' IDENTIFIED BY '${{ secrets.MYSQL_PASSWORD }}'" - sudo mysql -u root -e "GRANT ALL PRIVILEGES ON *.* TO '${{ secrets.MYSQL_USER }}'@'localhost'" - sudo mysql -u root -e "ALTER USER '${{ secrets.MYSQL_USER }}'@'localhost' IDENTIFIED WITH mysql_native_password by '${{ secrets.MYSQL_PASSWORD }}'" + sudo mysql -e "CREATE USER '$MYSQL_USER'@'localhost' IDENTIFIED BY '$MYSQL_PASSWORD'" + sudo mysql -u root -e "GRANT ALL PRIVILEGES ON *.* TO '$MYSQL_USER'@'localhost'" + sudo mysql -u root -e "ALTER USER '$MYSQL_USER'@'localhost' IDENTIFIED WITH mysql_native_password by '$MYSQL_PASSWORD'" sudo mysql -u root -e "FLUSH PRIVILEGES" - run: npm install - run: npm test - env: - MYSQL_HOST: '127.0.0.1' - MYSQL_USER: ${{ secrets.MYSQL_USER }} - MYSQL_PASSWORD: ${{ secrets.MYSQL_PASSWORD }} - CI: true code-lint: name: Code Lint runs-on: ubuntu-latest diff --git a/.setup.sh.swp b/.setup.sh.swp new file mode 100644 index 0000000000000000000000000000000000000000..3d457394d0960b69dc652ed88d8e8ee4c0dbc2d5 GIT binary patch literal 16384 zcmeI2ON<=F8OIA89UzxLVM&h6x9w-6Eq%;(9QeTHrj zY?g;#zr+hHH(etdGbaqnXRNU3GtU*@M$w>TxZ|?zy52xH&RTBzwP?7G!;H}Ni{s~l zb9OmkVdRy9(N-!|d6WW5fkc5jNo}?&Tzy7+klyp7V@esNfKosypcGIFCbk|K)um+w79dIAG7yJtc8kfO+;L{(Xd~hCw zpbWmcosciVN8kl;2@Jqjw;>&T0Iqf24ya#>@Oz?Lc#*9E86v2Bqy!k!&9SA`H762d9>)(Dr z-RQk!DM(+L!0M=EG!~3%2MoaHLln+a+a}~HL(kx>vMAoj1e2_+?H>&Q617Po7=04 z(dCsTRc+av`t5~Q=U5+BWM{2NShndpOniaC)5P%kSN`Gmt#Hd|HR}~3l9E4C@YG4A zvRaxgG387dsGpsq2U06evu5(t3w!rwe$t=N>b`xsjOd8Wgs-%i%MjR%d9)g&cOc6W zzv1yTL$ZQvOcAJZl0M;Jfh*l}}Gcc!~{i)7woTtfPpkh^(q z0*j}?6S^hLnNN1H_wq@T1)l4e^t=_0Xyn1}CU#gj(P;Nqdi`#D@$h7HNG7$el{AtO z8)KX_q+Xq^kco7dbtiMR!V?@GXY-bcC~{+Fqb;e7=Hb1*u?`{DyGY)7 zlNi(zPQ>R1lMVIAmi{DF+Guv*lQZf`{EtVDiM#V(@sLQz&sQtL#k}i;y5(SowgLuI!Jrw?hOVC^A#S_ZN8`QX(_=lNQoSakF;o9Z%;PjO)Db~^nP9=_^H5X)VV z@vNSSY#uEvb-MkzTCMUhEt(kSW@r9LtGm)(XdG^>iD0%b=X!F{BGs6TbgIk$G8$nr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