Git Product home page Git Product logo

gh-actions-html-table-generator's Introduction

Table generator

This GitHub Action creates a html table in your README.md from a json file.

Screenshot

Inputs

github-token [REQUIRED]

This is available in your GitHub Action

with:
    github-token: ${{ secrets.GITHUB_TOKEN }}

html-cell [REQUIRED]

This is the html table cell content with object-field-names

with:
    html-cell: '<td>{{ firstname }} {{ lastname }}</td>'

object-field-names [REQUIRED]

This is json, and contains a list of the names of the fields in your json file data object

with:
    object-field-names: '[ "firstname", "lastname" ]'

columns [OPTIONAL]

defaults to 2

with:
    columns: 3

json-file-path [OPTIONAL]

defaults to data.json

with:
    json-file-path: 'your-filename.json'

file-to-use [OPTIONAL]

Defaults to README.md

with:
    file-to-use: 'README.md'

Example usage

Add <!--START_SECTION:data-section--> and <!--END_SECTION:data-section--> where you would like your table to appear in your README.

jobs:
  table:
    runs-on: ubuntu-latest
    name: Update README from json data
    steps:
    - uses: actions/checkout@v2
    - name: Read/Write data into README
      uses: eddiejaoude/[email protected]
      with:
        json-file-path: 'data.json'
        github-token: ${{ secrets.GITHUB_TOKEN }}
        columns: 3
        object-field-names: '[ "githubUsername", "name", "imageUrl", "issueNumber" ]'
        file-to-use: 'README.md'
        html-cell: '<td align="center"><p><a href="https://github.com/{{ githubUsername }}">{{ name }}</a></p><img src="{{ imageUrl }}" /><p><a href="https://github.com/EddieJaoudeCommunity/awesome-github-profiles/issues/{{ issueNumber }}">(:100: give your vote)</a></p></td>'

Json file

[
    {
        "name": "Akas Rai",
        "githubUsername": "akasrai",
        "imageUrl": "https://user-images.githubusercontent.com/624760/88123456-d40df580-cbc2-11ea-9add-a7fc8675b243.png",
        "issueNumber": 12
    }
]

From this repository usage https://github.com/EddieJaoudeCommunity/awesome-github-profiles

gh-actions-html-table-generator's People

Contributors

eddiejaoude avatar panquesito7 avatar absphreak avatar muthuannamalai12 avatar peter-evans avatar sumit-sahu 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.