-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.js
More file actions
23 lines (23 loc) · 930 Bytes
/
test.js
File metadata and controls
23 lines (23 loc) · 930 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import { displayPayment, transferFunds } from './src/transfer.js';
async function main() {
try {
// Simulate the GitHub context payload
const payload = JSON.stringify({ event: 'push', repository: { name: 'example-repo' } }, undefined, 2);
const clientId = '';
const clientSecret = '';
const apiKey = '';
const accountId = '';
const paymentsFile = 'example-config.yml';
const payments = await displayPayment(paymentsFile);
console.log(payments);
const transactionIds = await transferFunds(clientId, clientSecret, apiKey, accountId, payments);
console.log(`Transaction IDs: ${JSON.stringify(transactionIds)}`);
//core.setOutput('transactionIds', JSON.stringify(transactionIds));
} catch (error) {
console.log(`Error: ${error.message}`);
}
}
// Only run if this file is executed directly (not imported)
if (process.argv[1] === new URL(import.meta.url).pathname) {
main();
}