peaceiris / actions-suggest-related-links

A GitHub Action to suggest related or similar issues, documents, and links. Based on the power of NLP and fastText.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Suggest Related Links Action

A GitHub Action to suggest related or similar issues, documents, and links. Based on the power of NLP and fastText.

Suggest Related Links Action example result | peaceiris/actions-suggest-related-links

Sometimes, users create a new issue that is similar to already opened or closed issues. When you face the issue, you need to find similar issues or related links and post it as a comment. That process is a pain, right? This action can do it instead of you!

license release GitHub release date Release Feed

codecov CodeFactor Maintainability

Table of Contents

Getting Started

Create Workflow

Create your YAML workflow file as follows.

e.g. .github/workflows/suggest-related-links.yml

name: 'Suggest Related Links'

on:
  issues:
    types:
      - opened
      - edited
  workflow_dispatch:
  schedule:
    - cron: '13 13 * * */7'

jobs:
  action:
    runs-on: ubuntu-18.04
    steps:
      - name: Cache dependencies
        uses: actions/cache@v2
        with:
          path: ~/actions-suggest-related-links-tmp
          key: ${{ runner.os }}-action-${{ hashFiles('~/actions-suggest-related-links-tmp/training-data.json') }}
          restore-keys: |
            ${{ runner.os }}-action-

      - uses: peaceiris/actions-suggest-related-links@v1.1.1
      - uses: peaceiris/actions-suggest-related-links/models/fasttext@v1.1.1
        if: github.event_name == 'issues'
        with:
          version: v1.1.1
      - uses: peaceiris/actions-suggest-related-links@v1.1.1
        with:
          mode: 'suggest'
          repository: 'peaceiris/actions-gh-pages'
          unclickable: true

Save Issues Data

Run It manually only the first time to save issues data. After the first running, it will be automatically executed following the setting of the schedule.cron.

Run workflow manually to save issues data | peaceiris/actions-suggest-related-links

Create Issue

Some related links which are similar to the created issue body will be listed by this action.

Suggest Related Links Action example result | peaceiris/actions-suggest-related-links

Overview

Our GitHub Action is actions-suggest-related-links, which suggests related or similar issues, documents, and links. This action mainly consists of 5 parts: Data Collection, Preprocessing, Train model, Find similar issues, and Suggest Issues.

Workflow Overview |

Data Collection

All issues of the repository are collected with the GitHub API. The issues include the title, body, and comments. Training Data is regularly collected using the scheduling function and output as an artifact and saved as a cache.

Preprocessing

The Markdown format is converted to plain text with unified. At this time, symbols that are not alphabetic characters are deleted.

Train Model

When a new issue is created or updated, the fastText model is trained. In accordance with its name, fastText has the advantage of very short inference times.

We think training time at the GitHub Actions runners won't be an issue. In the case of GitHub Actions for GitHub Pages repository, the training execution time is 1 sec and the total execution time is about 30 sec.

Find Similar Issues

Calculate word vectors of training data and word vectors of posted data in fastText. The cosine similarity is used to determine which word vectors of training data is close to the word vectors of the posted data. The higher the cosine similarity, the more similar the sentence.

Suggest Issues

Suggest Related Links Action example result | peaceiris/actions-suggest-related-links

Maintainers

License

About

A GitHub Action to suggest related or similar issues, documents, and links. Based on the power of NLP and fastText.

License:MIT License


Languages

Language:TypeScript 55.9%Language:Python 23.5%Language:Dockerfile 10.0%Language:Shell 5.2%Language:Makefile 4.6%Language:JavaScript 0.7%