Gh Actionのロゴ

Gh Action

組織人気
live-codes
gh-action

「Preview in LiveCodes」GitHub Actionを使い、プルリクエストのコード変更をプレビューするプレイグラウンドのリンクを生成します。プレイグラウンドの作成とPRへのコメント投稿を自動化します。

Add to TypingMind

概要

公開者live-codes
リポジトリlivecodes
スキル名gh-action
スター
1.5K
フォーク
271
同梱ファイル
指示のみ
ライセンスMIT
リンク
  • Markdown形式の指示

    モデルが必要に応じて読み込むSKILL.mdファイルです。関連するリクエストがあったときだけトークンを消費します。

  • どのLLMでも利用可能

    AIスキルはプロバイダー固有のコードではなく、通常のMarkdownなので、GPT、Claude、Gemini、Grok、ローカルモデルで利用できます。

  • 指示だけで完結

    モデルに必要なものはすべて指示に含まれているため、別途同期するファイルはありません。

  • オープンソース

    live-codesがGitHubで公開しています。インストールする前にソースを確認してください。

インストール

AIスキル「Gh Action」をTypingMindにインストールすれば、どのLLMでも利用できます。SKILL.mdを読み取れる別のAIエージェントに追加することもできます。

1

TypingMindにインストール

TypingMindはGitHubフォルダから直接スキルをインストールします。SKILL.mdを読み取り、リソースファイルをまとめてローカルに保存します。

  1. アプリを開き、「プラグイン」→「スキル」に移動します。
  2. 「GitHubからインストール」を選択します。
  3. 以下のスキルフォルダのURLを貼り付けて確定します。
    https://github.com/live-codes/livecodes/tree/develop/.agents/skills/livecodes/gh-action
  4. スキルを利用したいチャットごとに、そのスキルを有効にしてください。
「プラグイン」→「スキル」→「スキルを追加」→「GitHubのURLから」を選択し、フォルダのURLを貼り付けて「続行」を押します。
2

別のAIエージェントにインストール

Agent Skills形式を読み取れるAIエージェントなら、このスキルを利用できます。フォルダをそのAIエージェントのスキルディレクトリにコピーしてください。

Claude Code — .claude/skills
git clone --depth 1 https://github.com/live-codes/livecodes.git /tmp/livecodes
mkdir -p .claude/skills
cp -r /tmp/livecodes/.agents/skills/livecodes/gh-action .claude/skills/gh-action
コピー後、新しいスキルを読み込むためにClaude Codeを再起動してください。

TypingMindで使用

TypingMindのチャットでGh Actionを有効にするだけで、あとはモデルが対応します。名前と説明がシステムプロンプトに含まれ、関連するリクエストがあると、モデルが指示の全文を自動で読み込みます。手動で呼び出す必要はなく、実際に使用されるまでトークンを消費しません。

関連するリクエストがあるとすぐに、モデルが自動的にGh Actionを読み込みます。

どのAIモデルでも利用可能

AIスキルはプロバイダー固有のコードではなく、通常のMarkdownで書かれた指示です。そのため、Gh Actionは作成時に想定されたモデルに縛られません。TypingMindに一度インストールすれば、ご自身のAPIキーを使って、GPT-5、Claude、Gemini、Grok、DeepSeek、Mistral、Llama、またはご自身で実行するローカルモデルで利用できます。

  • 必要なときだけ読み込み

    システムプロンプトには名前と説明だけが含まれます。関連するリクエストが初めてあったときに指示を取得するため、スキルを使わない間は指示の読み込みにトークンを消費しません。

  • チャットの途中でモデルを切り替え

    スキルはコードではなく指示なので、モデルを切り替えてもそのまま使えます。次のモデルも同じSKILL.mdを読み込みます。

スキルの指示

モデルが読み込むSKILL.mdの内容です。スキルはモデルが従う指示なので、インストールする前に確認してください。

LiveCodes — GitHub Action: Preview in LiveCodes

The Preview in LiveCodes GitHub Action generates preview links to LiveCodes playgrounds for code changes in pull requests and posts them as PR comments.

Use case: Library authors can preview changes in the playground before merging PRs.

How It Works

  1. PR is created or updated
  2. Action optionally installs dependencies and builds the project
  3. Action scans .livecodes/ folder for playground configurations
  4. Generates playground URLs with your new code
  5. Posts comment with preview links to the PR

Setup

Two Required Workflow Files

The action requires two workflow files that must be merged to the default branch first.

1. Trigger workflow .github/workflows/livecodes-preview.yml:

yaml
name: livecodes

on: [pull_request]

jobs:
  build_and_prepare:
    runs-on: ubuntu-latest
    name: Generate Playgrounds
    steps:
      - name: Checkout
        uses: actions/checkout@v3

      - name: Build and generate
        uses: live-codes/preview-in-livecodes@v1
        with:
          # Optional: install-command: "npm install"
          # Optional: build-command: "npm run build"
          # Optional: base-url: "https://{{LC::REF}}.my-project.pages.dev"

2. Comment workflow .github/workflows/livecodes-post-comment.yml:

yaml
name: comment

on:
  workflow_run:
    workflows: ['livecodes']
    types:
      - completed

jobs:
  upload:
    runs-on: ubuntu-latest
    permissions:
      pull-requests: write
    if: >
      github.event.workflow_run.event == 'pull_request' &&
      github.event.workflow_run.conclusion == 'success'
    steps:
      - uses: live-codes/pr-comment-from-artifact@v1
        with:
          GITHUB_TOKEN: ${{ github.token }}

Two separate workflows are needed because each runs in a different security context. See GitHub security article for details.

Action Inputs

InputRequiredDescription
install-commandNoInstall command (e.g., npm install)
build-commandNoBuild command (e.g., npm run build)
base-urlNoBase URL for deployed assets. Supports dynamic values.
artifactNoArtifact name (default: pr)
GITHUB_TOKENNoGitHub token (default: ${{ github.token }})

Action Outputs

OutputDescription
messageMarkdown message with preview links for PR comment

Configure Playgrounds

Create JSON files in .livecodes/ folder. Each file becomes a playground link.

Example Configure Project JSON

.livecodes/hello-world.json:

json
{
  "title": "JavaScript Starter",
  "markup": {
    "language": "html",
    "content": "<h1>Hello, World!</h1>"
  },
  "script": {
    "language": "javascript",
    "content": "import { demo } from 'my-lib';\n\ndemo();"
  },
  "imports": {
    "my-lib": "{{LC::TO_DATA_URL(./index.js)}}"
  }
}

The title property becomes the playground name in the message. If omitted, filename is used.

Dynamic Values

Use these placeholders in project JSON and base-url:

PlaceholderDescription
{{LC::REF}}Branch or tag name of PR head
{{LC::SHA}}Full commit SHA
{{LC::SHORT_SHA}}Short SHA (first 7 characters)
{{LC::PR}}Pull request number
{{LC::REPO}}Repository name

File Placeholders (project JSON only)

PlaceholderDescription
{{LC::TO_URL(./file.js)}}URL of file with base-url prepended
{{LC::TO_DATA_URL(./file.js)}}File converted to data URL (for small files)

Using Newly Added Code in Playgrounds

Three strategies to make PR code available to playgrounds:

1. Deploy to Preview URL (Recommended)

Use Cloudflare Pages or Netlify for automatic preview deployments.

yaml
# workflow
base-url: 'https://{{LC::REF}}.my-project.pages.dev'

In project JSON:

json
{
  "imports": {
    "my-lib": "{{LC::TO_URL(./dist/index.js)}}"
  }
}

2. Use CDN Mirroring GitHub

Link to files via jsDelivr or similar:

yaml
# workflow
base-url: 'https://cdn.jsdelivr.net/gh/{{LC::REPO}}@{{LC::SHA}}/'

3. Data URLs (Small Files Only)

Encode files directly. Stored at dpaste.com (limit: 1M chars, expires after 365 days).

json
{
  "imports": {
    "my-lib": "{{LC::TO_DATA_URL(./index.js)}}"
  }
}

Common Mistakes

HIGH Workflow files not on default branch

The workflow files must be merged to the default branch (e.g., main) before the action can be triggered by PRs.

Wrong:

yaml
# Creating PR with workflow files
# Action won't run until merged to default branch

Correct:

bash
# First merge workflow files to default branch
git checkout main
git merge feature/add-gh-action
git push

# Now PRs can trigger the action

Source: GitHub Actions documentation on workflow_run event

MEDIUM Missing permissions for PR comments

The comment workflow needs pull-requests: write permission.

yaml
jobs:
  upload:
    permissions:
      pull-requests: write # Required!

MEDIUM Using data URLs for large files

Data URLs are limited to ~1M characters at dpaste.com. Large builds will fail.

Wrong:

json
{
  "imports": {
    "my-lib": "{{LC::TO_DATA_URL(./dist/bundle.js)}}" // Too large!
  }
}

Correct:

yaml
# Use base-url and TO_URL for large files
base-url: 'https://{{LC::REF}}.my-project.pages.dev'

Example PR Comment Output

markdown
## Preview in LiveCodes

**Latest commit:** abc1234  
**Last updated:** Jan 15, 2024 3pm (UTC)

|   Playground   | Link                                                               |
| :------------: | ------------------------------------------------------------------ |
| **JavaScript** | [https://livecodes.io?x=code/...](https://livecodes.io?x=code/...) |
|   **React**    | [https://livecodes.io?x=code/...](https://livecodes.io?x=code/...) |

See [documentations](https://github.com/live-codes/preview-in-livecodes) for usage instructions.

Related Skills

  • import-export - Understanding project configuration objects
  • self-hosting - Using custom appUrl for self-hosted playgrounds

よくある質問

AIスキル「Gh Action」では何ができますか?

「Preview in LiveCodes」GitHub Actionを使い、プルリクエストのコード変更をプレビューするプレイグラウンドのリンクを生成します。プレイグラウンドの作成とPRへのコメント投稿を自動化します。

TypingMindでGh Actionを使うメリットは何ですか?

一度インストールすれば、どのモデルでも使えるからです。Gh Actionはプロバイダー固有のコードではなく、通常のMarkdownで記述されているため、同じスキルをGPT-5、Claude、Gemini、Grok、ローカルモデルで利用できます。チャットの途中でモデルを切り替えても、そのまま使い続けられます。TypingMindは自分のAPIキーで動作するため、シート単位のサブスクリプションではなく、プロバイダーに直接料金を支払います。スキルとチャットは自分のストレージに保持されます。

TypingMindにGh Actionをインストールするにはどうすればよいですか?

TypingMindで「プラグイン」→「スキル」→「GitHubからインストール」を開き、https://github.com/live-codes/livecodes/tree/develop/.agents/skills/livecodes/gh-actionを貼り付けてください。TypingMindがSKILL.mdを読み込み、チャットごとに有効にできるスキルとしてインストールします。

Gh Actionを使えるAIモデルはどれですか?

TypingMindに接続したどのモデルでも利用できます。AIスキルはプロバイダー固有のコードではなく、通常のMarkdownで書かれた指示です。そのため、GPT、Claude、Gemini、Grok、ローカルモデルのいずれも、リクエストの内容がこのスキルの用途に合ったときに、このスキルを読み込めます。

Gh Actionで使えるAIモデルの数に制限はありますか?

数に制限はありません。スキルに対応したモデルであれば、GPT、Claude、Gemini、Grok、DeepSeek、Mistral、Llamaなど、どのモデルでもGh Actionを利用できます。すべてTypingMind上で、自分のAPIキーを使って利用できます。

AIスキル「Gh Action」は無料ですか?

はい。live-codesがMITライセンスのもとでGitHubに公開しています。ご利用のAIプロバイダーに支払うのは、使用したトークンの料金だけです。

AIスキルとは何ですか?

AIスキルは、特定のタスクの実行方法をAIモデルに教える、再利用可能な指示のセットです。オープンなAgent Skills形式に従い、名前と説明を含むSKILL.mdファイルに加え、モデルが必要とするスクリプト、テンプレート、参照ファイルで構成されます。モデルはリクエストがスキルに合致したときだけ指示を読み込むため、インストール済みのスキルも、使うまでは費用がかかりません。

AIスキルは、プラグインやMCPサーバーとどう違いますか?

プラグインやMCPサーバーは、モデルが呼び出せる新しいツールを提供します。ツールとは、どこかで実行され、結果を返すコードです。一方、AIスキルは、タスクへの取り組み方、従うべき手順、望ましい出力の例といった知識や進め方をモデルに伝えます。スキルは通常のMarkdownで記述されているため、サーバー、APIキー、実行環境は不要で、どのモデルでも利用できます。

すべて見る

今すぐ自分専用のAIワークスペースを作成

ニュースレターに登録すると、新機能や今後のプレゼント企画のお知らせが届きます👇