Giter VIP home page Giter VIP logo

aoc-widget-data-generator's Introduction

Advent of Code Data Action

Fetching all Advent of Code solutions and constructing them into a JSON file

This Action grabs all your Advent of Code solutions and consolidates them into a JSON object for further use. It will sort them by year, then language and then by day, with a link to your solution on GitHub. It will look somewhat like this:

{
  "2015": {
    "JavaScript": {
      "1": {
        "url": "https://..."
      }
    }
  }
}

You can view a production example here.

Installation and usage instructions

Create a new workflow under .github/workflows/aoc-data-generator.yml. Here is a working example:

name: Generate Advent of Code Data
on: push

jobs:
  generate:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - uses: actions/setup-node@v3
        with:
          node-version: 16
          cache: yarn
          # or npm or pnpm
      - run: |
          yarn install --frozen-lockfile
          yarn build
      - uses: wiktoriavh/aoc-widget-data-generator@v1
        with:
          year: 2015
          # the year the advent of code is from
          language: Go
          # the language you solved it in
          repo: wiktoriavh/advent-of-code-2015-go
          # needs to be owner/repo
          directory: days
          # the directory your solutions are in
          # they NEED to be numbered by day
          # day_01, day1, d01, 01 or 1 should all work
      - uses: stefanzweifel/git-auto-commit-action@v4
        with:
          commit_message: generating aoc data
          # you need to commit the new created file into your repository

Fetching more than one year

You can also fetch several years of different repos or of the same repo. You then just need to repeat the same, but with updated data. You can view a production example here.

- uses: wiktoriavh/aoc-widget-data-generator@v1
  with:
    year: 2015
    language: Go
    repo: wiktoriavh/advent-of-code-2015-go
    directory: days
- uses: wiktoriavh/aoc-widget-data-generator@v1
  with:
    year: 2021
    language: TypeScript
    repo: wiktoriavh/Advent-of-Code
    directory: 2021/src

You can also choose the output directory of where to save the new file.

- uses: wiktoriavh/aoc-widget-data-generator@v1
  with:
    year: 2015
    language: Go
    repo: wiktoriavh/advent-of-code-2015-go
    directory: days
    output: assets

aoc-widget-data-generator's People

Contributors

wiktoriavh avatar

Stargazers

Ingo Rockel avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.