Skip to content

Commit

Permalink
ci: hard code db credentials
Browse files Browse the repository at this point in the history
To fix Github Actions secrets access restriction for PRs originating from forks.

Signed-off-by: Rifa Achrinza <25147899+achrinza@users.noreply.github.com>
  • Loading branch information
achrinza committed Nov 15, 2023
1 parent c2034d5 commit 83d0763
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@ on:
# The branches below must be a subset of the branches above
branches: [master]

env:
CI: true

jobs:
build:
runs-on: ubuntu-22.04
Expand All @@ -26,17 +23,16 @@ 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
MYSQL_USER: myUser
MYSQL_PASSWORD: myPass
code-lint:
name: Code Lint
runs-on: ubuntu-latest
Expand Down
Binary file added .setup.sh.swp
Binary file not shown.

0 comments on commit 83d0763

Please sign in to comment.