Skip to content

KhudaDad414/workflows2md-action

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Repository files navigation

Generate Workflows Map

A GitHub action to create a map of your event-workflows map your workflows.

This action uses workflows-to-markdown under the hood to generate the file. If you have a node project or you want to generate the map locally, it may be easier to use the mentioned cli tool instead of this actions. This action is designed to generate the .md and you can use other actions to create a pull-request or commit to save the result.

Generate Workflows Map action will:

  1. Read your actions and create event-workflows map and a description table.
  2. Save those in a .md file.

Usage

    - uses: actions/checkout@v2 
    # generate .md file
    - uses: khudadad414@workflows2md-action
      id: workflows2md
    # save the changes with the action of your liking
    - uses: EndBug/add-and-commit@v7
      with:
       cwd: ${{env.GITHUB_WORKSPACE}}
       add: ${{ steps.workflows2md.outputs.path }}

Action inputs

All inputs are optional. If not set, sensible defaults will be used.

Name Description Default
input Relative path under GITHUB_WORKSPACE to the workflows folder. .github/workflows
output Relative path under GITHUB_WORKSPACE to the output .md file. WORKFLOWS.md

Action outputs

The following outputs can be used by subsequent workflow steps.

  • path - The path to the saved file.

Step outputs can be accessed as in the following example. Note that in order to read the step outputs the action step must have an id.

      - name: Generate workflows map
        id: workflows2md
        uses: @khudadad414/workflows2md-action
      - name: Check outputs
        run: |
          echo "Pull Request Number - ${{ steps.workflows2md.outputs.path }}"

Example

name: Generate Workflows Map
on:
  pull_request:
  push:
    branches:
      - main
      - 'release/*'

jobs:
  # test action works running from the graph
  test:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v2 
    - uses: ./
      id: workflows2md
    - uses: EndBug/add-and-commit@v7
      with:
       cwd: ${{env.GITHUB_WORKSPACE}}
       add: ${{ steps.workflows2md.outputs.path }}

Example Output

This is a map that has been generated from AsyncAPI's website workflows.

Event-Workflow Map

pull_ request_ target opened edited, synchronizereopened, ready_for_reviewunlocked, unlabeled, labeled
issues opened reopened unlabeled, labeled, closed, deleted edited
push master any **-release, next
pull_ request opened ready_for_review, synchronize, reopened edited
issue_ comment created edited
pull_ request_ review submitted edited
schedule At 12:00 AM
release published
discussion created
pull_ request_ review_ commentedited, created

Workflows

Workflow Description
Automerge For Humans Your first comment after name parameter in workflow will appear here.
Automerge release bump PR Your first comment after name parameter in workflow will appear here.
Notify slack Your first comment after name parameter in workflow will appear here.
Lint PR title Your first comment after name parameter in workflow will appear here.
Welcome first time contributors Your first comment after name parameter in workflow will appear here.
Remove ready-to-merge label Your first comment after name parameter in workflow will appear here.
Deploy to Netlify Your first comment after name parameter in workflow will appear here.
Sentiment Analysis Your first comment after name parameter in workflow will appear here.
Bump package version in dependent repos - if Node project Your first comment after name parameter in workflow will appear here.
Release - if Node project Your first comment after name parameter in workflow will appear here.
autoupdate Your first comment after name parameter in workflow will appear here.
PR testing - if Go project Your first comment after name parameter in workflow will appear here.
PR testing - if Node project Your first comment after name parameter in workflow will appear here.
Add ready-to-merge or do-not-merge label Your first comment after name parameter in workflow will appear here.
Create help comment Your first comment after name parameter in workflow will appear here.
Notify on failing automerge Your first comment after name parameter in workflow will appear here.
Manage stale issues and PRs Your first comment after name parameter in workflow will appear here.
Version bump - if Node.js project There is no need to substract "v" from the tag as version script handles it
Announce releases in different channels Your first comment after name parameter in workflow will appear here.

License

MIT