Skip to content

Commit

Permalink
chore: added theme contribution guidelines in theme preview bot (#797)
Browse files Browse the repository at this point in the history
* chore: added theme contribution guidelines in theme preview bot

* chore: test

* chore: format theme.js
  • Loading branch information
anuraghazra authored Jan 10, 2021
1 parent 2817bb9 commit 3c7ba21
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 9 deletions.
26 changes: 21 additions & 5 deletions scripts/preview-theme.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,15 @@ function getPrNumber() {
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() {
try {
const token = core.getInput("token");
Expand Down Expand Up @@ -48,7 +57,10 @@ async function run() {
repo: "github-readme-stats",
body: `
\rTheme preview (bot)
Cannot create theme preview
\rCannot create theme preview
${themeContribGuidelines}
`,
issue_number: pullRequestId,
});
Expand All @@ -58,10 +70,10 @@ async function run() {
color.replace(/.*\:\s/, "").replace(/\"/g, ""),
);

let titleColor = colors[0];
let iconColor = colors[1];
let textColor = colors[2];
let bgColor = colors[3];
const titleColor = colors[0];
const iconColor = colors[1];
const textColor = colors[2];
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`;

await octokit.issues.createComment({
Expand All @@ -75,7 +87,11 @@ async function run() {
\ntext-color: <code>#${textColor}</code>
\nbg-color: <code>#${bgColor}</code>
Link: ${url}
\r[![](${url})](${url})
${themeContribGuidelines}
`,
issue_number: pullRequestId,
});
Expand Down
8 changes: 4 additions & 4 deletions themes/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -249,20 +249,20 @@ const themes = {
title_color: "82aaff",
icon_color: "89ddff",
text_color: "27e8a7",
bg_color: "242938"
bg_color: "242938",
},
slateorange: {
title_color: "faa627",
icon_color: "faa627",
text_color: "ffffff",
bg_color: "36393f"
bg_color: "36393f",
},
kacho_ga: {
title_color: "bf4a3f",
icon_color: "a64833",
text_color: "d9c8a9",
bg_color: "402b23"
}
bg_color: "402b23",
},
};

module.exports = themes;

1 comment on commit 3c7ba21

@vercel
Copy link

@vercel vercel bot commented on 3c7ba21 Jan 10, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.