Add tweets plugin (#23)

* Add support for tweets plugin
This commit is contained in:
Simon Lecoq
2020-12-17 22:38:51 +01:00
committed by GitHub
parent 6eac410f03
commit 592fd9d7bb
21 changed files with 312 additions and 316 deletions

File diff suppressed because one or more lines are too long

View File

@@ -93,6 +93,7 @@
gists:{enabled:bool(core.getInput("plugin_gists"))},
topics:{enabled:bool(core.getInput("plugin_topics"))},
projects:{enabled:bool(core.getInput("plugin_projects"))},
tweets:{enabled:bool(core.getInput("plugin_tweets"))},
}
let q = Object.fromEntries(Object.entries(plugins).filter(([key, plugin]) => plugin.enabled).map(([key]) => [key, true]))
console.log(`Plugins enabled | ${Object.entries(plugins).filter(([key, plugin]) => plugin.enabled).map(([key]) => key).join(", ")}`)
@@ -147,6 +148,14 @@
q[`projects.${option}`] = core.getInput(`plugin_projects_${option}`) || null
console.log(`Projects limit | ${q["projects.limit"]}`)
}
//Tweets
if (plugins.tweets.enabled) {
plugins.tweets.token = core.getInput("plugin_tweets_token") || null
for (const option of ["limit"])
q[`tweets.${option}`] = core.getInput(`plugin_tweets_${option}`) || null
console.log(`Twitter token | ${plugins.tweets.token ? "provided" : "missing"}`)
console.log(`Tweets limit | ${q["tweets.limit"]}`)
}
//Repositories to use
const repositories = Number(core.getInput("repositories")) || 100