forked from NyaMisty/action-ipadown
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathappend2sheets.js
More file actions
32 lines (25 loc) · 807 Bytes
/
append2sheets.js
File metadata and controls
32 lines (25 loc) · 807 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
const { google } = require('googleapis');
(async () => {
const auth = new google.auth.GoogleAuth({
credentials: JSON.parse(process.env.GOOGLE_CREDENTIALS),
scopes: ['https://www.googleapis.com/auth/spreadsheets'],
});
const sheets = google.sheets({ version: 'v4', auth: await auth.getClient() });
const spreadsheetId = '1qAN8Eh4iPjO1aECiO1tclTXTLKfCka3StReywLJ3A58';
const values = [[
process.env.APP_VER,
`${new Date().getMonth() + 1}/${new Date().getDate()}/${new Date().getFullYear()}`,
'Yes',
process.env.APP_VER_ID
]];
await sheets.spreadsheets.values.append({
spreadsheetId,
range: 'ROBLOX',
valueInputOption: 'USER_ENTERED',
insertDataOption: 'INSERT_ROWS',
resource: {
values
},
});
console.log('Row appended.');
})();