LoginSignup
7
4

More than 3 years have passed since last update.

GitHub Actions(TODO to issue)を使ってTODOコメントからISSUEを自動的に作ってみた

Last updated at Posted at 2020-12-03

GitHub Actionsとは

  1. Github ActionsはGithubリポジトリ上でWorkflowを自動化することができるツールです。
  2. WorkflowはRunnersと呼ばれるGithubで管理しているマシンのLinux、macOS、Windows環境とコンテナで実行することができる。
  3. WorkflowはGithubリポジトリから発生するイベントに基づいて直接Workflowを作成することができる。
  4. Githubマーケットプレイスに共有されたWorkflowを検索可能
  5. 自分が直接作ったWorkflowを共有することができるコミュニティが存在する。 GitHub Actionsサイト

Github MarketPlaceから「TODO to issue」を検索

Github MarketPlaceから「TODO to issue」を検索してもいいし以下の「TODO to issue」から直接接続する。

GitHub MarketPlace
TODO to issue
スクリーンショット 2020-12-03 10.53.30.png

workflowsを追加

.github/workflows/フォルダを作ってtodo.ymlを生成する
GitHub Actionsのワークフロー構文についてはこちら
on: GithubのEvent設定 Eventについてはこちら参考

github/workflows/todo.yml
name: "TODO"
on: ["push"]
jobs:
  build:
    runs-on: "ubuntu-latest"
    steps:
      - uses: "actions/checkout@master"
      - name: "TODO to Issue"
        uses: "alstr/todo-to-issue-action@v2.3"
        id: "todo"
        with:
          TOKEN: ${{ secrets.GITHUB_TOKEN }}

テスト用ファイルを追加

TODOでコメントを記入する

test.rb
class Test
  def hello_world
    # TODO hello_worldの実装が必要
    'hello_world'
  end
end

Push

Pushするとコメント内容で自動的にIssueが作れます。
スクリーンショット 2020-12-03 12.42.26.png

Build結果

GithubのActionsタブをクリックするとActionsのBuild結果を確認できます。
スクリーンショット 2020-12-03 12.57.43.png

7
4
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
7
4