Skip to content

Commit

Permalink
fix: support-me input and logger
Browse files Browse the repository at this point in the history
  • Loading branch information
olivierodo committed Jan 1, 2023
1 parent 72e77a7 commit e20b84c
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 4 deletions.
12 changes: 10 additions & 2 deletions dist/index.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -38317,6 +38317,14 @@ var Schema = import_joi.default.object({
});
var content_default = Content;

// src/utils/logger.js
var Logger = class {
write(str) {
process.stdout.write(str + "\n");
}
};
var logger_default = Logger;

// src/index.js
async function Star(options) {
const {
Expand All @@ -38330,7 +38338,7 @@ async function Star(options) {
twitterOauthToken = process.env.TWITTER_OAUTH_TOKEN,
twitterOauthSecret = process.env.TWITTER_OAUTH_SECRET,
supportMe = process.env.SUPPORT_ME || true,
logger = process.stdout
logger = new logger_default()
} = options;
const github2 = new github_default({ username, token, repo, logger });
const twitterUsername = await github2.getTwitterUsername();
Expand Down Expand Up @@ -38378,7 +38386,7 @@ var import_github2 = __toESM(require_github(), 1);
twitterAppSecret: import_core3.default.getInput("twitter-app-secret") || void 0,
twitterOauthToken: import_core3.default.getInput("twitter-oauth-token") || void 0,
twitterOauthSecret: import_core3.default.getInput("twitter-oauth-secret") || void 0,
supportMe: import_core3.default.getInput("supportMe")
supportMe: import_core3.default.getInput("support-me")
};
await Star(options);
} catch (error) {
Expand Down
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import github from '@actions/github'
twitterAppSecret: core.getInput('twitter-app-secret') || undefined,
twitterOauthToken: core.getInput('twitter-oauth-token') || undefined,
twitterOauthSecret: core.getInput('twitter-oauth-secret') || undefined,
supportMe: core.getInput('supportMe')
supportMe: core.getInput('support-me')
}
await Star(options)
} catch(error) {
Expand Down
3 changes: 2 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import Discord from './services/discord.js'
import Twitter from './services/twitter.js'
import Github from './services/github.js'
import Content from './services/content.js'
import Logger from './utils/logger.js'

export default async function Star (options) {

Expand All @@ -16,7 +17,7 @@ export default async function Star (options) {
twitterOauthToken = process.env.TWITTER_OAUTH_TOKEN,
twitterOauthSecret = process.env.TWITTER_OAUTH_SECRET,
supportMe = process.env.SUPPORT_ME || true,
logger = process.stdout
logger = new Logger()
} = options

const github = new Github({ username, token, repo, logger})
Expand Down
8 changes: 8 additions & 0 deletions src/utils/logger.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
class Logger {

write(str) {
process.stdout.write(str + '\n')
}
}

export default Logger

0 comments on commit e20b84c

Please sign in to comment.