Giter Club home page Giter Club logo

action-to-mermaid's Introduction

Action to Mermaid

โ–ถ๏ธ to ๐Ÿงœโ€โ™€๏ธ

About

Now that GitHub renders Mermaid diagrams, here is a GitHub action that generates a Mermaid diagram out of an action's metadata file.

Overview

flowchart LR
input1(nwo):::optional-->action(Action to Mermaid):::action
input2(token):::optional-->action(Action to Mermaid):::action
action(Action to Mermaid)-->output1(mermaid):::output
classDef required fill:#6ba06a,stroke:#333,stroke-width:3px
classDef optional fill:#d9b430,stroke:#333,stroke-width:3px
classDef action fill:blue,stroke:#333,stroke-width:3px,color:#ffffff
classDef output fill:#fff,stroke:#333,stroke-width:3px,color:#333
Loading

Example usage

name: Mermaid

on:
  # Upon push to action.yml in the main branch
  push:  
    branches: [ main ]
    paths:
      - action.yml
  # Or upon manual trigger
  workflow_dispatch:

jobs:
  mermaid:
    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v2

      # Get Mermaid diagram for the action repository this workflow runs in
      # Use `nwo` option to change the action repository
      - name: Get Mermaid diagram
        id: mermaid
        uses: imjohnbo/action-to-mermaid@v0

      # Do something with Mermaid diagram, e.g. update README, output to separate file, etc.
      - name: Echo Mermaid diagram
        env:
          MERMAID: ${{ steps.mermaid.outputs.mermaid }}
        run: |-
          echo "$MERMAID"

Example output

```mermaid
flowchart LR
input1(nwo):::optional-->action(Action to Mermaid):::action
input2(token):::optional-->action(Action to Mermaid):::action
action(Action to Mermaid)-->output1(mermaid):::output
classDef required fill:#6ba06a,stroke:#333,stroke-width:3px
classDef optional fill:#d9b430,stroke:#333,stroke-width:3px
classDef action fill:blue,stroke:#333,stroke-width:3px,color:#ffffff
classDef output fill:#fff,stroke:#333,stroke-width:3px,color:#333
```

License

MIT

Contributing

Pull requests are welcome!

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.