Giter VIP home page Giter VIP logo

action-issue-to-hexo's Introduction

Issue to Hexo

This action converts a GitHub Issue to a Hexo post.

Template

In converting, this action takes information of an issue and set it to information of a post as follows:

GitHub Issue Hexo post Action
Title Title
Last updated date/time Date
Labels Tags
Body Content
Milestone Issue is converted only if milestone is set to publish

Usage

name: Issue to Hexo
on:
  issues:
    # Sufficient to trigger this workflow when an issue is milestoned
    types: [ milestoned ]
jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - uses: gsongsong/issue-to-hexo
        with:
          issue_url: ${{ github.event.issue.url }}
          # Personal access token used to get information of Issue
          token: ${{ secrets.token }}
      # At this point, a markdown file is generated and untracked
      # Take further action, e.g. generate (`hexo generate`), commit and push

Sponsor

If you feel this is useful, please consider to support me:

Buy Me A Coffee

action-issue-to-hexo's People

Contributors

somidad avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

Forkers

dncore

action-issue-to-hexo's Issues

Issue to Hexo

Issue URL

github.event.issue.url in GitHub Actions workflow (event = issues, types = milestoned)

Lock an issue (not necessary?)

PUT github.event.issue.url/lock (with authorization)

Issue information

GET github.event.issue.url (with authorization)

  • Title: data.title
  • Update date/time: data.updated_at
  • Labels (tags): data.labels[].name
  • Milestone (whether to publish): data.milestone.title
  • Body: data.body

Create a post

const Hexo = require('hexo');
const hexo = new Hexo(process.cwd(), {});
hexo.init().then(() => {
    hexo.post.create({
        title: data.title,
        date: data.updated_at,
        tags: data.labels.map((label) => label.name),
        content: body,
    });    
}).catch((reason) => {
    console.error(reason);
});

Close an issue

Set state to closed in PATCH github.event.issue.url (with authorization)

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.