chore: added theme contribution guidelines in theme preview bot (#797)

* chore: added theme contribution guidelines in theme preview bot

* chore: test

* chore: format theme.js
This commit is contained in:
Anurag Hazra 2021-01-10 13:16:01 +05:30 committed by GitHub
parent 2817bb9846
commit 3c7ba212b3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 25 additions and 9 deletions

View File

@ -12,6 +12,15 @@ function getPrNumber() {
return pullRequest.number; return pullRequest.number;
} }
const themeContribGuidelines = `
\r> Hi thanks for opening the theme contribution, please read our theme contribution guidelines
\r> We are currently only accepting color combinations from any vscode theme or which has good color combination to minimize bloating the themes collection.
\r> Also note that if this theme is exclusively for your personal use then instead of adding it to our theme collection you can use card [customization options](https://github.com/anuraghazra/github-readme-stats#customization)
\r> Read our [contribution guidelines](https://github.com/anuraghazra/github-readme-stats/blob/master/CONTRIBUTING.md) for more info
`;
async function run() { async function run() {
try { try {
const token = core.getInput("token"); const token = core.getInput("token");
@ -48,7 +57,10 @@ async function run() {
repo: "github-readme-stats", repo: "github-readme-stats",
body: ` body: `
\rTheme preview (bot) \rTheme preview (bot)
Cannot create theme preview
\rCannot create theme preview
${themeContribGuidelines}
`, `,
issue_number: pullRequestId, issue_number: pullRequestId,
}); });
@ -58,10 +70,10 @@ async function run() {
color.replace(/.*\:\s/, "").replace(/\"/g, ""), color.replace(/.*\:\s/, "").replace(/\"/g, ""),
); );
let titleColor = colors[0]; const titleColor = colors[0];
let iconColor = colors[1]; const iconColor = colors[1];
let textColor = colors[2]; const textColor = colors[2];
let bgColor = colors[3]; const bgColor = colors[3];
const url = `https://github-readme-stats.vercel.app/api?username=anuraghazra&title_color=${titleColor}&icon_color=${iconColor}&text_color=${textColor}&bg_color=${bgColor}&show_icons=true`; const url = `https://github-readme-stats.vercel.app/api?username=anuraghazra&title_color=${titleColor}&icon_color=${iconColor}&text_color=${textColor}&bg_color=${bgColor}&show_icons=true`;
await octokit.issues.createComment({ await octokit.issues.createComment({
@ -75,7 +87,11 @@ async function run() {
\ntext-color: <code>#${textColor}</code> \ntext-color: <code>#${textColor}</code>
\nbg-color: <code>#${bgColor}</code> \nbg-color: <code>#${bgColor}</code>
Link: ${url}
\r[![](${url})](${url}) \r[![](${url})](${url})
${themeContribGuidelines}
`, `,
issue_number: pullRequestId, issue_number: pullRequestId,
}); });

View File

@ -249,20 +249,20 @@ const themes = {
title_color: "82aaff", title_color: "82aaff",
icon_color: "89ddff", icon_color: "89ddff",
text_color: "27e8a7", text_color: "27e8a7",
bg_color: "242938" bg_color: "242938",
}, },
slateorange: { slateorange: {
title_color: "faa627", title_color: "faa627",
icon_color: "faa627", icon_color: "faa627",
text_color: "ffffff", text_color: "ffffff",
bg_color: "36393f" bg_color: "36393f",
}, },
kacho_ga: { kacho_ga: {
title_color: "bf4a3f", title_color: "bf4a3f",
icon_color: "a64833", icon_color: "a64833",
text_color: "d9c8a9", text_color: "d9c8a9",
bg_color: "402b23" bg_color: "402b23",
} },
}; };
module.exports = themes; module.exports = themes;