Skip to content
archive

GitHub Action

hugo-with-github-issues

v1.7 Latest version

hugo-with-github-issues

archive

hugo-with-github-issues

Convert github issues to markdowns

Installation

Copy and paste the following snippet into your .yml file.

              

- name: hugo-with-github-issues

uses: skyfe79/[email protected]

Learn more about this action in skyfe79/hugo-with-github-issues

Choose a version

Convert Github issues to markdowns.

hugo-with-github-issues converts github issues to markdowns. Github issue has a title and comments. hugo-with-github-issues connects comments to the one body content. Github issue supports to upload images to the comments so markdown can contains images.

Example Repo

This issue is

converted below the post:

Command Labels

  • ::./content/{specific folder name} - store markdown file to the content/{specific folder name}
  • ::DRAFT - skip conversion.
  • ::DONE - skip conversion.

Usage

This is workflow example:

name: "Convert issues to markdowns"
on:
  workflow_dispatch:
    
jobs:
  convert_issues_to_markdown_job:
    runs-on: ubuntu-latest
    name: Convert issues to markdowns.
    steps:
      - name: checkout
        uses: actions/checkout@v1
      - name: Fetch issues and generate markdowns
        uses: skyfe79/[email protected]
        with:
          github-token: ${{ secrets.GITHUB_TOKEN }}
          repo: 'testing-hugo-with-github-issues'
          owner: 'skyfe79'
          skip-author: 'utterances-bot'
          use-issue-seperator: 'false'
          output: 'content/posts'
      - name: Commit files
        run: |
          git config --local user.email "[email protected]"
          git config --local user.name "sungcheol kim"
          git add .
          git commit -m "Add Posts"
      - name: Push changes
        uses: ad-m/github-push-action@master
        with:
          github_token: ${{ secrets.GITHUB_TOKEN }}
          branch: ${{ github.ref }}

Inputs

github-token:
  description: 'github token'
  required: true

repo:
  description: 'repo to export'
  required: true

owner:
  description: 'repo owner'
  required: true

skip-author:
  description: 'skip issue written by the skip-author'
  required: false

skip-pull-requests:
  description: 'skip pull request issue'
  required: true
  default: false

issue-state:
  description: 'export issues only in state(all, open or closed)'
  required: true
  default: 'all'

use-issue-seperator:
  description: 'use seperator among comments'
  required: true
  default: 'false'

output:
  description: 'destination folder to store markdown files'
  required: true
  default: 'content'