Skip to content

Commit

Permalink
consoleRemove
Browse files Browse the repository at this point in the history
  • Loading branch information
AndreiMarin15 committed Sep 23, 2023
1 parent cc0b452 commit e5a4b8d
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 3 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/update-notion.js.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Notion Update CI

on:
push:
branches: ["development", "main", "feature/notion-db-automation"]

jobs:
build:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [16.x, 18.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
defaults:
run:
working-directory: ./scripts
steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: "npm"

- run: npm ci
- run: |
touch .env.local
echo NOTION_INTEGRATION_SECRET=${{ secrets.NOTION_INTEGRATION_SECRET }} >> .env.local
echo NOTION_LEADS_DEVDB=${{ secrets.NOTION_LEADS_DEVDB }} >> .env.local
echo NOTION_LEADS_PRODDB=${{ secrets.NOTION_LEADS_PRODDB }} >> .env.local
- run: npm run build --if-present
- run: npm run start
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
/node_modules
/.pnp
.pnp.js
scripts/node_modules

# testing
/coverage
Expand Down
9 changes: 6 additions & 3 deletions scripts/index.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@


const { Client } = require("@notionhq/client");
require("dotenv").config({
path: ".env.local",
path: "./.env.local",
});

console.log(process.env.NOTION_LEADS_PRODDB)
console.log(process.env.NOTION_LEADS_DEVDB)
// Initializing a client
const notion = new Client({
auth: process.env.NOTION_INTEGRATION_SECRET,
Expand Down Expand Up @@ -78,7 +81,7 @@ async function queryDb(databaseId) {
database_id: databaseId,
});

console.log(response.results[response.results.length-1].properties.Avatar.files[0].name)
// console.log(response.results[response.results.length-1].properties.Avatar.files[0].name)
return response;
}

Expand Down

0 comments on commit e5a4b8d

Please sign in to comment.