Skip to content

Commit 6408b08

Browse files
author
jawher.kallel
committed
resolve error at pipeline github action
1 parent 56c8374 commit 6408b08

File tree

2 files changed

+17
-8
lines changed

2 files changed

+17
-8
lines changed

.github/workflows/node.js.yml

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node
2-
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs
3-
41
name: Node.js CI
52

63
on:
@@ -11,13 +8,11 @@ on:
118

129
jobs:
1310
build:
14-
1511
runs-on: ubuntu-latest
1612

1713
strategy:
1814
matrix:
1915
node-version: [18.x, 20.x, 22.x]
20-
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
2116

2217
steps:
2318
- uses: actions/checkout@v4
@@ -26,6 +21,17 @@ jobs:
2621
with:
2722
node-version: ${{ matrix.node-version }}
2823
cache: 'npm'
29-
- run: npm ci
30-
- run: npm run build --if-present
31-
- run: npm test
24+
25+
- name: Install dependencies
26+
run: npm ci
27+
28+
- name: Set up environment variables
29+
env:
30+
DATABASE_URL: ${{ secrets.DATABASE_URL }}
31+
run: echo "Environment variable DATABASE_URL has been set."
32+
33+
- name: Build project
34+
run: npm run build --if-present
35+
36+
- name: Run tests
37+
run: npm test

config/db.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ const pool = new Pool({
88
password: process.env.DB_PASSWORD,
99
port: process.env.DB_PORT,*/
1010
connectionString: process.env.DATABASE_URL,
11+
ssl: {
12+
rejectUnauthorized: false,
13+
},
1114
});
1215

1316
pool.on('connect', () => {

0 commit comments

Comments
 (0)