-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
27 lines (21 loc) · 830 Bytes
/
index.js
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
const core = require('@actions/core');
const github = require('@actions/github');
const snoowrap = require('snoowrap');
const fs = require("fs");
try {
const wrapper = new snoowrap({
userAgent: 'github action',
clientId: core.getInput("reddit_client_id"),
clientSecret: core.getInput("reddit_client_secret"),
username: core.getInput("reddit_user_name"),
password: core.getInput("reddit_user_password")
});
const subName = core.getInput('sub_name');
const dir = fs.readdirSync("./")
console.log("dir is",dir);
// Get the JSON webhook payload for the event that triggered the workflow
const payload = JSON.stringify(github.context.payload, undefined, 2)
console.log(`The event payload: ${payload}`);
} catch (error) {
core.setFailed(error.message);
}