[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.

Fixed action inputs

Kasper (Aug 23, 2020, 7:42 PM +0200) d3bf0ed1 5204ed2b

+40 -33
+5 -5
EXAMPLE_OUTPUT.md
··· 3 3 4 4 ## latest vidl release (custom) 5 5 6 - [vidl 3.5.0](https://github.com/probablykasper/vidl/releases/tag/3.5.0) (21 days ago) 6 + [vidl 3.5.0](https://github.com/probablykasper/vidl/releases/tag/3.5.0) (22 days ago) 7 7 8 8 ## Specific repos (custom) 9 9 ··· 37 37 - **SIGNUP_DATE2**: 2015-03-04 38 38 - **SIGNUP_YEAR**: 2015 39 39 - **SIGNUP_AGO**: 5 years ago 40 - - **TOTAL_REPOS_SIZE_KB**: 707453 40 + - **TOTAL_REPOS_SIZE_KB**: 707467 41 41 - **TOTAL_REPOS_SIZE_MB**: 707.5 42 42 - **TOTAL_REPOS_SIZE_GB**: 0.71 43 - - **TOTAL_REPOSITORIES**: 46 43 + - **TOTAL_REPOSITORIES**: 47 44 44 45 45 ## 3 most starred repos 46 46 ··· 54 54 55 55 | ⭐️Stars | 📦Repo | 📚Description | 56 56 | --------- | ----------- | -------------- | 57 + | 0 | [probablykasper/readme-template-action-test](https://github.com/probablykasper/readme-template-action-test) | test repo for readme-template-action | 57 58 | 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 | 58 59 | 0 | [probablykasper/embler](https://github.com/probablykasper/embler) | Turn binaries into applications | 59 - | 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. | 60 60 61 61 ## 3 recently pushed repos 62 62 63 63 | ⭐️Stars | 📦Repo | 📚Description | 64 64 | --------- | ----------- | -------------- | 65 + | 0 | [probablykasper/readme-template-action-test](https://github.com/probablykasper/readme-template-action-test) | test repo for readme-template-action | 65 66 | 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 | 66 67 | 0 | [probablykasper/cpc](https://github.com/probablykasper/cpc) | Text calculator with support for units and conversion | 67 - | 0 | [probablykasper/embler](https://github.com/probablykasper/embler) | Turn binaries into applications |
+4 -4
EXAMPLE_TEMPLATE.md
··· 10 10 'golang/go', 11 11 'probablykasper/embler', 12 12 ], 13 + modifyVariables: function(repo, moment, user) { 14 + repo.REPO_CREATED_MYDATE = moment(repo.REPO_CREATED_TIMESTAMP).format('YYYY MMMM Do') 15 + return repo 16 + }, 13 17 }, 14 18 "2_MOST_STARRED_REPOS": { 15 19 type: 'repos', ··· 19 23 ownerAffiliations:[OWNER], 20 24 orderBy: { field:STARGAZERS, direction: DESC }, 21 25 `, 22 - modifyVariables: function(repo, moment, user) { 23 - repo.REPO_CREATED_MYDATE = moment(repo.REPO_CREATED_TIMESTAMP).format('YYYY MMMM Do') 24 - return repo 25 - }, 26 26 }, 27 27 LATEST_VIDL_RELEASE: { 28 28 type: 'customQuery',
+23 -21
README.md
··· 21 21 Workflow: 22 22 23 23 ```yml 24 + name: Readme Template 24 25 on: 25 - schedule: 26 - - cron: '0 */2 * * *' # every 2 hours 27 - push: 28 - branchesL 29 - - master 26 + schedule: 27 + - cron: '0 */2 * * *' # every 2 hours 28 + push: 29 + branches: [ master ] 30 30 jobs: 31 31 publish: 32 32 runs-on: ubuntu-latest 33 33 steps: 34 - - uses: actions/checkout@v2 35 - with: 36 - fetch-depth: 0 37 - - name: Generate README.md 38 - uses: probablykasper/readme-template 39 - with: 40 - github_token: ${{ secrets.GITHUB_TOKEN }} 41 - - name: Update README.md 42 - run: | 43 - if [[ "$(git status --porcelain)" != "" ]]; then 44 - git config user.name "GitHub Action" 45 - git config user.email "action@github.com" 46 - git add . 47 - git commit -m "Update README" 48 - git push 49 - fi 34 + - uses: actions/checkout@v2 35 + with: 36 + fetch-depth: 0 37 + - name: Generate README.md 38 + uses: probablykasper/readme-template-action 39 + with: 40 + github_token: ${{ secrets.GITHUB_TOKEN }} 41 + template: TEMPLATE.md 42 + output: README.md 43 + - name: Update README.md 44 + run: | 45 + if [[ "$(git status --porcelain)" != "" ]]; then 46 + git config user.name "GitHub Action" 47 + git config user.email "action@github.com" 48 + git add . 49 + git commit -m "Auto-update README.md" 50 + git push 51 + fi 50 52 ``` 51 53 52 54 `TEMPLATE.md`:
+4
action.yml
··· 2 2 author: 'Kasper Henningsen' 3 3 description: 'Insert variables into markdown file using a template file' 4 4 inputs: 5 + github_token: 6 + description: 'Your github personal access token with `read:user` scope' 7 + required: true 8 + default: 'TEMPLATE.md' 5 9 template: 6 10 description: 'The file to use as template' 7 11 required: true
+2 -2
index.js
··· 69 69 async function run() { 70 70 try { 71 71 72 - let templatePath = core.getInput('TEMPLATE') 72 + let templatePath = core.getInput('TEMPLATE', { required: true }) 73 73 console.log('template:', templatePath) 74 74 if (!fs.existsSync(templatePath)) throw newErr('Template file not found') 75 75 const templateFile = fs.readFileSync(templatePath).toString() 76 76 77 - let outputPath = core.getInput('OUTPUT') 77 + let outputPath = core.getInput('OUTPUT', { required: true }) 78 78 console.log('output:', outputPath) 79 79 80 80 let { customTemplate, outputStr } = getCustomTemplate(templateFile)
+2 -1
src/queries.js
··· 2 2 const github = require('@actions/github') 3 3 const moment = require('moment') 4 4 5 - const ghToken = core.getInput('GITHUB_TOKEN') 5 + const ghToken = core.getInput('GITHUB_TOKEN', { required: true }) 6 + core.setSecret(ghToken) 6 7 const octokit = github.getOctokit(ghToken) 7 8 module.exports.octokit = octokit 8 9