Skip to content

Commit

Permalink
Prepare release v0.1.2
Browse files Browse the repository at this point in the history
  • Loading branch information
vn7n24fzkq committed Sep 3, 2020
1 parent 8896f32 commit d08ca8c
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 22 deletions.
50 changes: 29 additions & 21 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -17801,8 +17801,8 @@ const createProfileDetailsCard = async function (username) {
contributionsData,
theme
);
//output to folder
writeSVG(themeName, "profile-details", svgString);
//output to folder, use 0- prefix for sort in preview
writeSVG(themeName, "0-profile-details", svgString);
}
};

Expand All @@ -17825,9 +17825,13 @@ const createReposPerLanguageCard = async function (username) {

for (let themeName in Themes) {
let theme = Themes[themeName];
let svgString = createDonutChartCard("Repos per Language (top 5)", langData, theme);
//output to folder
writeSVG(themeName, "repos-per-language", svgString);
let svgString = createDonutChartCard(
"Repos per Language (top 5)",
langData,
theme
);
//output to folder, use 1- prefix for sort in preview
writeSVG(themeName, "1-repos-per-language", svgString);
}
};

Expand Down Expand Up @@ -17870,8 +17874,8 @@ const createCommitsPerLanguageCard = async function (username) {
langData,
theme
);
//output to folder
writeSVG(themeName, "most-commit-language", svgString);
//output to folder, use 2- prefix for sort in preview
writeSVG(themeName, "2-most-commit-language", svgString);
}
};

Expand Down Expand Up @@ -17951,13 +17955,13 @@ const main = async () => {
} catch (error) {
core.error(`Error when creating CommitsPerLanguageCard \n${error}`);
}
try {
core.info(`Createing preview markdown...`);
await generatePreviewMarkdown(isInGithubAction);
} catch (error) {
core.error(`Error when creating preview markdown \n${error}`);
}
if (isInGithubAction) {
try {
core.info(`Createing preview markdown...`);
await generatePreviewMarkdown();
} catch (error) {
core.error(`Error when creating preview markdown \n${error}`);
}
core.info(`Commit file...`);
await commitFile();
}
Expand Down Expand Up @@ -20295,7 +20299,10 @@ const Themes = __webpack_require__(4637);
const GITHUB_REPOSITORY = process.env.GITHUB_REPOSITORY;

// If neither a branch or tag is available for the event type, the variable will not exist. https://docs.github.com/en/actions/configuring-and-managing-workflows/using-environment-variables
const GITHUB_BRANCH = process.env.GITHUB_REF == undefined ? "master":process.env.GITHUB_REF.split("/").pop();
const GITHUB_BRANCH =
process.env.GITHUB_REF == undefined
? "master"
: process.env.GITHUB_REF.split("/").pop();

const writeSVG = function (folder, filename, svgString) {
const targetFolder = `${outputPath}${folder}/`;
Expand All @@ -20316,29 +20323,30 @@ function getAllFileInFolder(folder) {
return files;
}

const generatePreviewMarkdown = function (pro) {
const generatePreviewMarkdown = function (isInGithubAction) {
let targetFolder = `${outputPath}`;
let readmeContent = "";
readmeContent +=
`
let urlPrefix = isInGithubAction
? `https://raw.githubusercontent.com/${GITHUB_REPOSITORY}/${GITHUB_BRANCH}/profile-summary-card-output`
: `.`;
readmeContent += `
# Preview Cards

Here are all cards with themes.

`;

for (let themeName in Themes) {
readmeContent +=
`
readmeContent += `
### ${themeName}

`;
for (let file of getAllFileInFolder(targetFolder + themeName)) {
readmeContent += `
\`\`\`
![](https://raw.githubusercontent.com/${GITHUB_REPOSITORY}/${GITHUB_BRANCH}/profile-summary-card-output/${themeName}/${file})
![](${urlPrefix}/${themeName}/${file})
\`\`\`
![](https://raw.githubusercontent.com/${GITHUB_REPOSITORY}/${GITHUB_BRANCH}/profile-summary-card-output/${themeName}/${file})
![](${urlPrefix}/${themeName}/${file})

`;
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "github-profile-summary-cards",
"version": "0.0.1",
"version": "0.1.2",
"description": "Generate github profile summary cards",
"main": "src/app.js",
"scripts": {
Expand Down

0 comments on commit d08ca8c

Please sign in to comment.