[READ-ONLY] Mirror of https://github.com/probablykasper/readme-template-action. Integrate GitHub API data in your README.md
0

Configure Feed

Select the types of activity you want to include in your feed.

Fetch data conditionally

Kasper (Aug 23, 2020, 5:31 AM +0200) 76adff1e 94098343

+23 -25
-14
EXAMPLE_OUTPUT.md
··· 40 40 - **TOTAL_REPOS_SIZE_GB**: 0.71 41 41 - **TOTAL_REPOSITORIES**: 46 42 42 43 - ## 3 newest repos list 44 43 45 - | ⭐️Stars | 📦Repo | 📚Description | 46 - | --------- | ----------- | -------------- | 47 - | 0 | [probablykasper/readme-template-action](https://github.com/probablykasper/readme-template-action) | Fills in variables (with loop support) from a TEMPLATE.md into a README.md | 48 - | 0 | [probablykasper/embler](https://github.com/probablykasper/embler) | Turn binaries into applications | 49 - | 0 | [probablykasper/svelte-preprocess](https://github.com/probablykasper/svelte-preprocess) | A ✨ magical ✨ Svelte preprocessor with sensible defaults and support for: PostCSS, SCSS, Less, Stylus, Coffeescript, TypeScript, Pug and much more. | 50 - 51 - ## 3 recently pushed repos 52 - 53 - | ⭐️Stars | 📦Repo | 📚Description | 54 - | --------- | ----------- | -------------- | 55 - | 0 | [probablykasper/readme-template-action](https://github.com/probablykasper/readme-template-action) | Fills in variables (with loop support) from a TEMPLATE.md into a README.md | 56 - | 0 | [probablykasper/cpc](https://github.com/probablykasper/cpc) | Text calculator with support for units and conversion | 57 - | 0 | [probablykasper/embler](https://github.com/probablykasper/embler) | Turn binaries into applications |
+8
EXAMPLE_TEMPLATE.md
··· 67 67 - **TOTAL_REPOS_SIZE_GB**: {{ TOTAL_REPOS_SIZE_GB }} 68 68 - **TOTAL_REPOSITORIES**: {{ TOTAL_REPOSITORIES }} 69 69 70 + ## 3 most starred repos 71 + 72 + | ⭐️Stars | 📦Repo | 📚Description | 73 + | --------- | ----------- | -------------- | 74 + {{ loop 3_MOST_STARRED_REPOS }} 75 + | {{ REPO_STARS }} | [{{ REPO_FULL_NAME }}]({{ REPO_URL }}) | {{ REPO_DESCRIPTION }} | 76 + {{ end 3_MOST_STARRED_REPOS }} 77 + 70 78 ## 3 newest repos list 71 79 72 80 | ⭐️Stars | 📦Repo | 📚Description |
+15 -11
index.js
··· 120 120 for (const [templateName, template] of Object.entries(customTemplate)) { 121 121 if (template.type === 'repos' || template.type === 'specificRepos') { 122 122 123 - console.log(templateName+': Fetching') 124 - const repos = template.type === 'repos' 125 - ? await queries.getRepos(template.params) 126 - : await queries.getSpecificRepos(user.USERNAME, template.repos) 127 - if (typeof template.modifyVariables === 'function') { 128 - for (let i = 0; i < repos.length; i++) { 129 - repos[i] = template.modifyVariables(repos[i]) 130 - } 131 - } 132 123 133 - console.log(templateName+': Injecting') 134 - outputStr = await injectLoop(outputStr, templateName, repos) 124 + console.log(templateName) 125 + console.log(' - Looking for') 126 + outputStr = await injectLoop(outputStr, templateName, async () => { 127 + console.log(' - Fetching') 128 + const repos = template.type === 'repos' 129 + ? await queries.getRepos(template.params) 130 + : await queries.getSpecificRepos(user.USERNAME, template.repos) 131 + if (typeof template.modifyVariables === 'function') { 132 + for (let i = 0; i < repos.length; i++) { 133 + repos[i] = template.modifyVariables(repos[i]) 134 + } 135 + } 136 + console.log(' - Injecting') 137 + return repos 138 + }) 135 139 136 140 } else { 137 141 throw new Error(`Invalid template type "${template.type}"`)