Giter VIP home page Giter VIP logo

github-issue-to-hexo's Introduction

github-issue-to-hexo

This action can convert a github issue to hexo source post

Usage

example

name: 部署博客

env:
  # hexo源文件仓库
  BLOG_SOURCE: flytam/blog-source
  # issue链接
  ISSUE_URL: https://github.com/flytam/blog/issues
  # blog部署的页面
  BLOG: flytam/blog
  # ${{ github.event.issue.user.login }}

on:
  issues:
    types: [opened, edited]
jobs:
  build:
    runs-on: ubuntu-latest
    # 仓库作者才才能触发
    if: ${{ github.actor == github.repository_owner }}
    steps:
      - name: 拉取hexo源文件
        uses: actions/checkout@v3
        with:
          persist-credentials: 'false'
          repository: ${{ env.BLOG_SOURCE }}
          ref: main
          token: ${{ secrets.token }}
      - name: issue生成 hexo文章
        uses: flytam/github-issue-to-hexo@main
        with:
          issue_url: ${{ env.ISSUE_URL }}
          output: source/_posts
          replace: true
      - name: commit hexo源文件
        run: |
          echo $(date) > update.md
          git add .
          git config user.name "issue-to-hexo bot"
          git config user.email "[email protected]"
          git commit -m "Add a post"
      - name: 推送hexo源文件
        uses: ad-m/github-push-action@master
        with:
          github_token: ${{ secrets.token }}
          repository: ${{ env.BLOG_SOURCE }}

Action params

  • output string

The directory of the hexo source. Default source/_posts

  • issue_url string

The github issue url. Like https://github.com/flytam/blog/issues

  • replace boolean

Whether to replace the contents of the original directory. Default false

github-issue-to-hexo's People

Contributors

flytam avatar infinitesum 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.