{"id":16228080,"url":"https://github.com/vnphanquang/monkeytype-readme","last_synced_at":"2026-03-07T05:32:27.164Z","repository":{"id":103151676,"uuid":"470006128","full_name":"vnphanquang/monkeytype-readme","owner":"vnphanquang","description":"Github action for updating monkeytype personal best badge in Readme","archived":false,"fork":false,"pushed_at":"2022-12-14T10:18:38.000Z","size":452,"stargazers_count":19,"open_issues_count":3,"forks_count":3,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-02-11T09:30:55.338Z","etag":null,"topics":["actions","github-actions","monkeytype","readme"],"latest_commit_sha":null,"homepage":"https://github.com/vnphanquang/monkeytype-readme","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vnphanquang.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-03-15T04:32:01.000Z","updated_at":"2025-12-27T08:04:46.000Z","dependencies_parsed_at":null,"dependency_job_id":"f10b510d-1aff-4d29-ba4d-f739ecb653c6","html_url":"https://github.com/vnphanquang/monkeytype-readme","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/vnphanquang/monkeytype-readme","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vnphanquang%2Fmonkeytype-readme","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vnphanquang%2Fmonkeytype-readme/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vnphanquang%2Fmonkeytype-readme/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vnphanquang%2Fmonkeytype-readme/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vnphanquang","download_url":"https://codeload.github.com/vnphanquang/monkeytype-readme/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vnphanquang%2Fmonkeytype-readme/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30208731,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-07T05:23:27.321Z","status":"ssl_error","status_checked_at":"2026-03-07T05:00:17.256Z","response_time":53,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["actions","github-actions","monkeytype","readme"],"created_at":"2024-10-10T12:54:33.632Z","updated_at":"2026-03-07T05:32:27.140Z","avatar_url":"https://github.com/vnphanquang.png","language":"TypeScript","funding_links":["https://www.buymeacoffee.com/vnphanquang"],"categories":[],"sub_categories":[],"readme":"\n# Monkeytype Stats in Github Readme\n\n\u003cdiv align=\"center\"\u003e\n\n[![codecov.badge]][codecov] [![github.release.badge]][github.release] [![semantic-release.badge]][semantic-release] [![MIT][license.badge]][license]\n\n[![actions.ci.badge]][actions.ci] [![actions.release.badge]][actions.release]\n\n[![tweet]][tweet.url]\n\n\u003c/div\u003e\n\n## Table of Contents\n\n\u003cdetails open\u003e\n  \u003csummary\u003eShow / hide\u003c/summary\u003e\n\n- [Monkeytype Stats in Github Readme](#monkeytype-stats-in-github-readme)\n  - [Table of Contents](#table-of-contents)\n  - [Changelog](#changelog)\n  - [Demo](#demo)\n  - [Preparation](#preparation)\n    - [Static Usage](#static-usage)\n    - [Dynamic Github Readme Update](#dynamic-github-readme-update)\n      - [1. Readme Resource Declaration](#1-readme-resource-declaration)\n      - [2. Monkeytype API Key](#2-monkeytype-api-key)\n  - [Github Action Workflow](#github-action-workflow)\n    - [Edge Cases](#edge-cases)\n  - [Endpoint Documentation](#endpoint-documentation)\n  - [Contributing](#contributing)\n\n\u003c/details\u003e\n\n## [Changelog][github.changelog]\n\n## Demo\n\n(Sometimes it takes a bit of time or some browser refresh for the badges below to all appear. If someone knows why let me know ^_^)\n\n\u003cdetails open\u003e\n  \u003csummary\u003eStyle variants: show / hide\u003c/summary\u003e\n\n| style | demo |\n| --- | --- |\n| flat | [![monkeytype.badge.flat]][monkeytype] |\n| flat-square | [![monkeytype.badge.flat-square]][monkeytype] |\n| plastic | [![monkeytype.badge.plastic]][monkeytype] |\n| for-the-badge | [![monkeytype.badge.for-the-badge]][monkeytype] |\n\n\u003c/details\u003e\n\n\u003cdetails open\u003e\n  \u003csummary\u003eIcon variants: show / hide\u003c/summary\u003e\n\n| icon | demo |\n| --- | --- |\n| one | [![monkeytype.badge.for-the-badge]][monkeytype] |\n| two | [![monkeytype.badge.for-the-badge-two]][monkeytype] |\n\n\u003c/details\u003e\n\n## Preparation\n\n### Static Usage\n\n\u003cdetails open\u003e\n  \u003csummary\u003eShow / hide\u003c/summary\u003e\n\nThis project's strategy relies on [shields.io endpoint api][shields.io.endpoint]. For one time \u0026 static badge, follow the steps below.\n\n1. Edit this endpoint to your liking:\n\n    ```\n    https://monkeytype-badge-vhd5lan7mmhz.runkit.sh?message=...\u0026label=...\u0026logoVariant=...\n    ```\n\n    See [Endpoint Documentation](#endpoint-documentation) for more details about the query params.\n\n2. Parse (1) and use [shields.io endpoint helper][shields.io.endpoint] to further customize your badge.\n\n    ![shields.io.endpoint.customize]\n\n\u003c/details\u003e\n\n### Dynamic Github Readme Update\n\n\u003cdetails open\u003e\n  \u003csummary\u003eShow / hide\u003c/summary\u003e\n\n#### 1. Readme Resource Declaration\n\nPut the following at the bottom of your README. This is a default badge that will get updated by the github action...\n\n```markdown\n[monkeytype.badge]: https://img.shields.io/endpoint?style=flat\u0026url=https%3A%2F%2Fmonkeytype-badge-vhd5lan7mmhz.runkit.sh\n```\n\nYou can display this badge somewhere in your readme as below\n\n![monkeytype.badge.default]\n\n```markdown\n\u003c!-- For just the image --\u003e\n![!monkeytype.badge]\n\n\u003c!-- For clickable image that links to monkeytype website --\u003e\n[![monkeytype.badge]](https://monkeytype.com/)\n```\n\n#### 2. Monkeytype API Key\n\nGo to [monkeytype.settings], search for the `ape key` section, then generate and save an API Key somewhere for the next step. Remember to activate your key at the end to (might be a little checkbox at the left).\n\n![monkeytype.settings.ape-key]\n\nAdd this key as a Action secret in your repo's settings.\n\n![screenshots.github-secret]\n\nNow follow the [next section](#github-action-workflow) to set up a github workflow.\n\n\u003c/details\u003e\n\n## Github Action Workflow\n\nSee [action.yaml] for description about the inputs.\n\nI recommend keeping the `workflow_dispatch` trigger so you can run the action manually whenever you want.\n\nSince personal bests don't change that often, in the example I leave it to run once every week. But you can use the [crontab-guru] site to adjust as needed.\n\n\u003cdetails open\u003e\n  \u003csummary\u003eExample: show / hide\u003c/summary\u003e\n\n```yaml\n# .github/workflow/monkeytype.yaml\nname: Monkeytype Readme\n\non:\n  # Runs if triggered manually through github action console\n  workflow_dispatch:\n  schedule:\n    # Runs at 00:00 each sunday\n    - cron: '0 0 * * 0'\n\njobs:\n  update-readme:\n    name: Update README\n    runs-on: ubuntu-latest\n    # it shouldn't take longer than a few minutes\n    # but leave a timeout here in case request hangs\n    timeout-minutes: 10\n    steps:\n      - uses: vnphanquang/monkeytype-readme@main\n        with:\n          # required:\n          monkeytype_api_key: ${{ secrets.MONKEYTYPE_API_KEY }}\n          mode: 'time'\n          mode2: '30'\n          # not required with default:\n          style: 'flat' # option from shields.io\n          logoVariant: 'one'\n          label: 'monkeytype'\n  # outputs badge_url should you need to use that in later steps\n```\n\n\u003c/details\u003e\n\n### Edge Cases\n\nSome edge cases to expect:\n\n- If your personal best stays the same at the time the action runs, no update should be made to README (the action still succeeds but it should have skipped that step).\n- If an invalid `mode` / `mode2` is passed, the action should fail with a `MonkeytypePersonalBestNotFoundError` error.\n- In case monkeytype server is down, the action should also fail.\n- In case runkit server is down, a generic error badge from `shields.io` should be displayed.\n  ![invalid shields.io endpoint url](https://img.shields.io/endpoint?url=something%20invalid)\n- If any of the above server hangs, the action should timeout (provided you include a `timeout-minutes` input in the action).\n\nIf you encounter other edge cases not covered above, please [open an issue][github.issues] to let me know. Thanks a lot!\n\n## Endpoint Documentation\n\nSee [the code on runkit][runkit]. The endpoint is:\n\n```\nhttps://monkeytype-badge-vhd5lan7mmhz.runkit.sh\n```\n\n\u003cdetails open\u003e\n  \u003csummary\u003eQuery params: show / hide\u003c/summary\u003e\n\n| name | required | default | description |\n| --- | --- | --- | --- |\n| `message` | no | `calculating` | message to display on the badge, usually something like '120wpm' |\n| `logoVariant` | no | `one` | the logo variant to use, see [Demo](#demo). Accepts only the string `one` or `two` |\n| `label` | no | `monkeytype` | the text next to the icon |\n\n\u003c/details\u003e\n\n## Contributing\n\n[Read Contribution Guide][github.contributing]\n\n\u003cbr /\u003e\n\u003cdiv align=\"center\"\u003e\n\n[![tweet]][tweet.url]\n\n\u003c/div\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://www.buymeacoffee.com/vnphanquang\" target=\"_blank\"\u003e\n    \u003cimg\n      src=\"https://cdn.buymeacoffee.com/buttons/v2/default-yellow.png\"\n      height=\"60\"\n      width=\"217\"\n      alt=\"buy vnphanquang a coffee\"\n    /\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n[monkeytype.badge.default]: https://img.shields.io/endpoint?style=flat\u0026url=https%3A%2F%2Fmonkeytype-badge-vhd5lan7mmhz.runkit.sh\n[monkeytype.badge.flat]: https://img.shields.io/endpoint?style=flat\u0026url=https%3A%2F%2Fmonkeytype-badge-vhd5lan7mmhz.runkit.sh%3Fmessage%3D200wpm%26label%3Dmonkeytype%26style%26logoVariant%3Done\n[monkeytype.badge.flat-square]: https://img.shields.io/endpoint?style=flat-square\u0026url=https%3A%2F%2Fmonkeytype-badge-vhd5lan7mmhz.runkit.sh%3Fmessage%3D200wpm%26label%3Dmonkeytype%26style%26logoVariant%3Done\n[monkeytype.badge.plastic]: https://img.shields.io/endpoint?style=plastic\u0026url=https%3A%2F%2Fmonkeytype-badge-vhd5lan7mmhz.runkit.sh%3Fmessage%3D200wpm%26label%3Dmonkeytype%26style%26logoVariant%3Done\n[monkeytype.badge.for-the-badge]: https://img.shields.io/endpoint?style=for-the-badge\u0026url=https%3A%2F%2Fmonkeytype-badge-vhd5lan7mmhz.runkit.sh%3Fmessage%3D200wpm%26label%3Dmonkeytype%26style%26logoVariant%3Done\n[monkeytype.badge.for-the-badge-two]: https://img.shields.io/endpoint?style=for-the-badge\u0026url=https%3A%2F%2Fmonkeytype-badge-vhd5lan7mmhz.runkit.sh%3Fmessage%3D200wpm%26label%3Dmonkeytype%26style%26logoVariant%3Dtwo\n\n[monkeytype]: https://monkeytype.com/\n[monkeytype.settings]: https://monkeytype.com/settings\n[monkeytype.settings.ape-key]: ./public/monkeytype-settings-apekey.png\n\n[codecov.badge]: https://codecov.io/github/vnphanquang/monkeytype-readme/coverage.svg?branch=main\n[codecov]: https://codecov.io/github/vnphanquang/monkeytype-readme?branch=main\n\n[license.badge]: https://img.shields.io/badge/license-MIT-blue.svg\n[license]: ./LICENSE\n\n[semantic-release]: https://github.com/semantic-release/semantic-release\n[semantic-release.badge]: https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg\n\n[github.changelog]: ./CHANGELOG\n[github.contributing]: ./CONTRIBUTING\n[github.issues]: https://github.com/vnphanquang/monkeytype-readme/issues?q=\n\n[github.release.badge]: https://img.shields.io/github/v/release/vnphanquang/monkeytype-readme\n[github.release]: https://github.com/vnphanquang/monkeytype-readme/releases\n\n[actions.ci.badge]: https://github.com/vnphanquang/monkeytype-readme/actions/workflows/ci.yaml/badge.svg\n[actions.ci]: https://github.com/vnphanquang/monkeytype-readme/actions/workflows/ci.yaml\n\n[actions.release.badge]: https://github.com/vnphanquang/monkeytype-readme/actions/workflows/release.yaml/badge.svg\n[actions.release]: https://github.com/vnphanquang/monkeytype-readme/actions/workflows/release.yaml\n\n[runkit]: https://runkit.com/vnphanquang/monkeytype-badge\n[runkit.endpoint]: https://monkeytype-badge-vhd5lan7mmhz.runkit.sh\n\n[shields.io.endpoint]: https://shields.io/endpoint\n[shields.io.endpoint.customize]: ./public/shieldsio-endpoint.png\n\n[screenshots.github-secret]: ./public/github-secret.png\n\n[action.yaml]: ./action.yaml\n\n[crontab-guru]: https://crontab.guru/\n\n[tweet]: https://img.shields.io/twitter/url?style=social\u0026url=https%3A%2F%2Fgithub.com%2vnphanquang%2Fmonkeytype-readme\n[tweet.url]: https://twitter.com/intent/tweet?text=monkeytype%20badge%20-%20automatically%20update%20personal%20best%20in%20github%20reamde%0A%0Ahttps%3A%2F%2Fgithub.com%2Fvnphanquang%2Fmonkeytype-readme\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvnphanquang%2Fmonkeytype-readme","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvnphanquang%2Fmonkeytype-readme","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvnphanquang%2Fmonkeytype-readme/lists"}