{"id":16377526,"url":"https://github.com/j0b10/aoc-badges-action","last_synced_at":"2025-07-26T07:10:28.045Z","repository":{"id":45654830,"uuid":"318809886","full_name":"J0B10/aoc-badges-action","owner":"J0B10","description":"Github Action to update the badges of your Readme to show your current Advent of Code stats","archived":false,"fork":false,"pushed_at":"2024-02-10T12:37:00.000Z","size":41,"stargazers_count":125,"open_issues_count":1,"forks_count":12,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-05-07T01:07:52.114Z","etag":null,"topics":["advent-of-code","advent-of-code-2021","badge-generator","badges"],"latest_commit_sha":null,"homepage":"","language":"Python","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/J0B10.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"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":"2020-12-05T14:33:56.000Z","updated_at":"2025-01-14T03:27:51.000Z","dependencies_parsed_at":"2024-01-15T20:47:11.253Z","dependency_job_id":"7d74f2b9-3bb4-4948-a434-073d7c798e7d","html_url":"https://github.com/J0B10/aoc-badges-action","commit_stats":{"total_commits":44,"total_committers":8,"mean_commits":5.5,"dds":0.5681818181818181,"last_synced_commit":"4da8f7098d348fae7da76daeeebcc12f3a8f290b"},"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/J0B10%2Faoc-badges-action","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/J0B10%2Faoc-badges-action/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/J0B10%2Faoc-badges-action/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/J0B10%2Faoc-badges-action/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/J0B10","download_url":"https://codeload.github.com/J0B10/aoc-badges-action/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253112078,"owners_count":21856070,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["advent-of-code","advent-of-code-2021","badge-generator","badges"],"created_at":"2024-10-11T03:43:27.430Z","updated_at":"2025-05-08T16:55:08.464Z","avatar_url":"https://github.com/J0B10.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# AoC-badges\nGithub Action to update the [badges](https://github.com/badges/shields) of your Readme to show your current stats for [Advent of Code](https://adventofcode.com/).\n\nHave a look at these examples:\n\n![](https://img.shields.io/badge/day%20📅-22-blue)\n![](https://img.shields.io/badge/stars%20⭐-34-yellow)\n\n## Setup\nFirst of all you have to add the badges to your README.\nYou can use only some of them or even customize them to fit your needs.  \nNote that if you want to customize the badges you might have to tweak the regular expressions used to match your badges.\nHere are the default ones:\n\n| Badge                                                    | Raw Badge                                                 | Description                                            |\n|----------------------------------------------------------|-----------------------------------------------------------|--------------------------------------------------------|\n| ![](https://img.shields.io/badge/day%20📅-22-blue)        | `![](https://img.shields.io/badge/day%20📅-22-blue)`       | Displays the current calendar day                      |\n| ![](https://img.shields.io/badge/stars%20⭐-34-yellow)   | `![](https://img.shields.io/badge/stars%20⭐-34-yellow)`  | Displays the total amount of collected stars           |\n| ![](https://img.shields.io/badge/days%20completed-17-red) | `![](https://img.shields.io/badge/days%20completed-17-red)` | Displyas on how many days you completed all tasks      |\n\nThe default values for the regular expressions can be found in the [`actions.yml`](https://github.com/joblo2213/AoC-badges/blob/master/action.yml)\nif you need to tweak them.\n\nThe action will search through your readme and updates all badges it finds using the provided (or default) regular expressions.\n\nNext you have to obtain your session and your user id.  \nGo to [Advent of Code leaderboards](https://adventofcode.com/2020/leaderboard/private) and click on `[Create]` and then on `[View]` to visit your private leaderboard.\nThen have a look at the url, the numbers at the end are your user id:\n\n```\nhttps://adventofcode.com/2020/leaderboard/private/view/\u003cyouruserId\u003e\n```\n\nTo get your session secret press F12 while you are logged in on [adventofcode.com](https://adventofcode.com/) to open the developer tools of your browser.  \nThen open the `Application` Tab on Chromium Browsers or `Storage` on firefox. There you can have a look at your cookies and copy the session id.\nYou need to add this session id as [encrypted secret](https://docs.github.com/en/free-pro-team@latest/actions/reference/encrypted-secrets#creating-encrypted-secrets-for-a-repository) to your repository.\n\nNow you can set up the workflow. The sample workflow beyond will help you.  \n\nIf you want to set up badges for multiple years in one repository just add this action multiple times (once for each year using the `year` input).  \nHave slightly different badges for each year with a custom regex using the regex inputs.  \nThe day badge probably doesn't makes sense for multiple years as it only depends on the current date (and therefore only works in December).\n\n## Sample Workflow\n\n```yml\nname: Update AoC Badges\non:\n  schedule:                                      # run workflow based on schedule\n    - cron: '6 5 1-25 12 *'                      # from the 1. December till 25. December every day at 5:06am (avoid load at full hours)\n    \n  workflow_dispatch:                             # allow to manually start the workflow \n  \n# push:                                          # (disabled) run on push, be carefull with this setting \n                                                 # as the workflow should only be triggered at a rate lower than\n                                                 # 4 times a hour to keep traffic on aoc site low \njobs:\n  update:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions/checkout@v2                # clones your repo\n          \n      - uses: joblo2213/aoc-badges-action@v3\n        with:\n          userid: 00000                          # your user id, see setup on how to obtain\n          session: ${{ secrets.AOC_SESSION }}    # secret containing session code, see setup on how to obtain\n          \n#         Optional inputs:\n#         \n#         year: 2021                                                                                     # The year for which stats should be retrieved\n#         leaderboard: 'https://adventofcode.com/2020/leaderboard/private/view/00000.json'               # The url of the leaderboard from witch the data is fetched. Typically your private leaderboard.\n#         file: 'README.md'                                                                              # The file that contains the badges\n#         dayRegex: '(?\u003c=https:\\/\\/img\\.shields\\.io\\/badge\\/day%20📅-)[0-9]+(?=-blue)'                   # Regular expression that finds the content of the day badge in your file.\n#         starsRegex: '(?\u003c=https:\\/\\/img\\.shields\\.io\\/badge\\/stars%20⭐-)[0-9]+(?=-yellow)'             # Regular expression that finds the content of the stars badge in your file.\n#         daysCompletedRegex: '(?\u003c=https:\\/\\/img\\.shields\\.io\\/badge\\/days%20completed-)[0-9]+(?=-red)'  # Regular expression that finds the content of the days completed badge iun your file.\n\n      - uses: stefanzweifel/git-auto-commit-action@v4     # Step that pushes these local changes back to your github repo\n        with:\n          commit_message: Update badges\n          file_pattern: README.md\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fj0b10%2Faoc-badges-action","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fj0b10%2Faoc-badges-action","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fj0b10%2Faoc-badges-action/lists"}