Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
90 changes: 90 additions & 0 deletions .github/actions/repomix/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
name: "Repomix Action"
description: "Pack repository contents into a single file that is easy for LLMs to process"
author: "Kazuki Yamada <koukun0120@gmail.com>"
branding:
icon: archive
color: purple

inputs:
directories:
description: "Space-separated list of directories to process (defaults to '.')"
required: false
default: "."
include:
description: "Comma-separated glob patterns to include"
required: false
default: ""
ignore:
description: "Comma-separated glob patterns to ignore"
required: false
default: ""
output:
description: "Relative path to write packed file"
required: false
default: "repomix.txt"
compress:
description: "Set to 'false' to disable smart compression"
required: false
default: "true"
additional-args:
description: "Any extra raw arguments to pass directly to the repomix CLI"
required: false
default: ""
repomix-version:
description: "Version (or tag) of the npm package to install – defaults to latest"
required: false
default: "latest"

runs:
using: "composite"
steps:
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "22"
cache: "npm"
- name: Install Repomix
shell: bash
run: |
npm install --global repomix@${{ inputs.repomix-version }}
- name: Run Repomix
id: build
shell: bash
run: |
set -e
# Using an array for safer command execution
# Safely split directories input into an array, handling spaces correctly
IFS=' ' read -r -a ARGS <<< "${{ inputs.directories }}"

if [ -n "${{ inputs.include }}" ]; then
ARGS+=(--include "${{ inputs.include }}")
fi

if [ -n "${{ inputs.ignore }}" ]; then
ARGS+=(--ignore "${{ inputs.ignore }}")
fi

if [ "${{ inputs.compress }}" = "false" ]; then
ARGS+=(--no-compress)
else
ARGS+=(--compress)
fi

ARGS+=(--output "${{ inputs.output }}")

# Only add additional args if not empty
if [ -n "${{ inputs.additional-args }}" ]; then
# Use safer parsing for additional arguments
IFS=' ' read -r -a ADDITIONAL_ARGS <<< "${{ inputs.additional-args }}"
ARGS+=("${ADDITIONAL_ARGS[@]}")
fi

echo "Running: repomix ${ARGS[*]}"
repomix "${ARGS[@]}"

echo "output_file=${{ inputs.output }}" >> "$GITHUB_OUTPUT"

outputs:
output_file:
description: "Path to the file generated by Repomix"
value: ${{ steps.build.outputs.output_file }}
56 changes: 56 additions & 0 deletions .github/workflows/test-action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Test Repomix Action

on:
workflow_dispatch:
push:
paths:
- '.github/actions/repomix/**'

jobs:
test-action:
name: Test Node.js ${{ matrix.node-version }}
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18, 20, 22]
include:
- node-version: 18
test-case: "minimal"
- node-version: 20
test-case: "basic"
- node-version: 22
test-case: "full"
steps:
- uses: actions/checkout@v4

- name: Run Repomix Action (Minimal)
if: matrix['test-case'] == 'minimal'
uses: ./.github/actions/repomix
with:
output: "repomix-minimal-output.txt"

- name: Run Repomix Action (Basic)
if: matrix['test-case'] == 'basic'
Comment thread
yamadashy marked this conversation as resolved.
uses: ./.github/actions/repomix
with:
directories: "src"
include: "**/*.ts"
output: "repomix-basic-output.txt"
compress: "true"

- name: Run Repomix Action (Full)
if: matrix['test-case'] == 'full'
uses: ./.github/actions/repomix
with:
directories: "src tests"
include: "**/*.ts,**/*.md"
ignore: "**/*.test.ts"
output: "repomix-full-output.txt"
compress: "true"
additional-args: "--no-file-summary"

- name: Upload result
uses: actions/upload-artifact@v4
with:
name: repomix-output-node${{ matrix.node-version }}
path: repomix-*-output.txt
63 changes: 63 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -944,6 +944,69 @@ repomix --no-security-check
> Disabling security checks may expose sensitive information. Use this option with caution and only when necessary, such
> as when working with test files or documentation that contains example credentials.

## 🤖 Using Repomix with GitHub Actions

You can also use Repomix in your GitHub Actions workflows. This is useful for automating the process of packing your codebase for AI analysis.

Basic usage:

```yaml
- name: Pack repository with Repomix
uses: yamadashy/repomix/.github/actions/repomix@main
with:
Comment thread
yamadashy marked this conversation as resolved.
directories: src
include: "**/*.ts"
output: repomix-output.txt
```

Pack specific directories with compression:

```yaml
- name: Pack repository with Repomix
uses: yamadashy/repomix/.github/actions/repomix@main
with:
directories: src tests
include: "**/*.ts,**/*.md"
ignore: "**/*.test.ts"
output: repomix-output.txt
compress: true
```

Upload the output file as an artifact:

```yaml
- name: Pack repository with Repomix
uses: yamadashy/repomix/.github/actions/repomix@main
with:
directories: src
output: repomix-output.txt
compress: true

- name: Upload Repomix output
uses: actions/upload-artifact@v4
with:
name: repomix-output
path: repomix-output.txt
```

### Action Inputs

| Name | Description | Default |
|------|-------------|---------|
| `directories` | Space-separated list of directories to process (e.g., `src tests docs`) | `.` |
| `include` | Comma-separated glob patterns to include files (e.g., `**/*.ts,**/*.md`) | `""` |
| `ignore` | Comma-separated glob patterns to ignore files (e.g., `**/*.test.ts,**/node_modules/**`) | `""` |
| `output` | Relative path for the packed file (extension determines format: `.txt`, `.md`, `.xml`) | `repomix.txt` |
| `compress` | Enable smart compression to reduce output size by pruning implementation details | `true` |
| `additional-args` | Extra raw arguments for the repomix CLI (e.g., `--no-file-summary --no-security-check`) | `""` |
| `repomix-version` | Version of the npm package to install (supports semver ranges, tags, or specific versions like `0.2.25`) | `latest` |

### Action Outputs

| Name | Description |
|------|-------------|
| `output_file` | Path to the generated output file. Can be used in subsequent steps for artifact upload, LLM processing, or other operations. The file contains a formatted representation of your codebase based on the specified options. |

## 📚 Using Repomix as a Library

In addition to using Repomix as a CLI tool, you can also use it as a library in your Node.js applications.
Expand Down
1 change: 1 addition & 0 deletions website/client/.vitepress/config/configDe.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ export const configDe = defineConfig({
{ text: 'Code-Komprimierung', link: '/de/guide/code-compress' },
{ text: 'Sicherheit', link: '/de/guide/security' },
{ text: 'MCP-Server', link: '/de/guide/mcp-server' },
{ text: 'GitHub Actions', link: '/de/guide/github-actions' },
{
text: 'Tipps & Tricks',
items: [{ text: 'Best Practices', link: '/de/guide/tips/best-practices' }],
Expand Down
1 change: 1 addition & 0 deletions website/client/.vitepress/config/configEnUs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ export const configEnUs = defineConfig({
{ text: 'Code Compression', link: '/guide/code-compress' },
{ text: 'Security', link: '/guide/security' },
{ text: 'MCP Server', link: '/guide/mcp-server' },
{ text: 'GitHub Actions', link: '/guide/github-actions' },
{
text: 'Tips & Tricks',
items: [{ text: 'Best Practices', link: '/guide/tips/best-practices' }],
Expand Down
1 change: 1 addition & 0 deletions website/client/.vitepress/config/configEs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ export const configEs = defineConfig({
{ text: 'Compresión de Código', link: '/es/guide/code-compress' },
{ text: 'Seguridad', link: '/es/guide/security' },
{ text: 'Servidor MCP', link: '/es/guide/mcp-server' },
{ text: 'GitHub Actions', link: '/es/guide/github-actions' },
{
text: 'Consejos y Trucos',
items: [{ text: 'Mejores Prácticas', link: '/es/guide/tips/best-practices' }],
Expand Down
1 change: 1 addition & 0 deletions website/client/.vitepress/config/configFr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ export const configFr = defineConfig({
{ text: 'Compression de code', link: '/fr/guide/code-compress' },
{ text: 'Sécurité', link: '/fr/guide/security' },
{ text: 'Serveur MCP', link: '/fr/guide/mcp-server' },
{ text: 'GitHub Actions', link: '/fr/guide/github-actions' },
{
text: 'Astuces et conseils',
items: [{ text: 'Meilleures pratiques', link: '/fr/guide/tips/best-practices' }],
Expand Down
1 change: 1 addition & 0 deletions website/client/.vitepress/config/configJa.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ export const configJa = defineConfig({
{ text: 'コード圧縮', link: '/ja/guide/code-compress' },
{ text: 'セキュリティ', link: '/ja/guide/security' },
{ text: 'MCPサーバー', link: '/ja/guide/mcp-server' },
{ text: 'GitHub Actions', link: '/ja/guide/github-actions' },
{
text: 'ヒント&テクニック',
items: [{ text: 'ベストプラクティス', link: '/ja/guide/tips/best-practices' }],
Expand Down
1 change: 1 addition & 0 deletions website/client/.vitepress/config/configKo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ export const configKo = defineConfig({
{ text: '코드 압축', link: '/ko/guide/code-compress' },
{ text: '보안', link: '/ko/guide/security' },
{ text: 'MCP 서버', link: '/ko/guide/mcp-server' },
{ text: 'GitHub Actions', link: '/ko/guide/github-actions' },
{
text: '팁과 요령',
items: [{ text: '모범 사례', link: '/ko/guide/tips/best-practices' }],
Expand Down
1 change: 1 addition & 0 deletions website/client/.vitepress/config/configPtBr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ export const configPtBr = defineConfig({
{ text: 'Compressão de Código', link: '/pt-br/guide/code-compress' },
{ text: 'Segurança', link: '/pt-br/guide/security' },
{ text: 'Servidor MCP', link: '/pt-br/guide/mcp-server' },
{ text: 'GitHub Actions', link: '/pt-br/guide/github-actions' },
{
text: 'Dicas e Truques',
items: [{ text: 'Melhores Práticas', link: '/pt-br/guide/tips/best-practices' }],
Expand Down
1 change: 1 addition & 0 deletions website/client/.vitepress/config/configZhCn.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ export const configZhCn = defineConfig({
{ text: '代码压缩', link: '/zh-cn/guide/code-compress' },
{ text: '安全性', link: '/zh-cn/guide/security' },
{ text: 'MCP 服务器', link: '/zh-cn/guide/mcp-server' },
{ text: 'GitHub Actions', link: '/zh-cn/guide/github-actions' },
{
text: '技巧与窍门',
items: [{ text: '最佳实践', link: '/zh-cn/guide/tips/best-practices' }],
Expand Down
97 changes: 97 additions & 0 deletions website/client/src/de/guide/github-actions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
# Verwendung von Repomix mit GitHub Actions

Sie können den Verpackungsprozess Ihres Codebases für die KI-Analyse automatisieren, indem Sie Repomix in Ihre GitHub Actions Workflows integrieren. Dies ist nützlich für Continuous Integration (CI), Code-Reviews oder die Vorbereitung für LLM-Tools.

## Grundlegende Nutzung

Fügen Sie den folgenden Schritt zu Ihrer Workflow-YAML-Datei hinzu, um Ihr Repository zu verpacken:

```yaml
- name: Pack repository with Repomix
uses: yamadashy/repomix/.github/actions/repomix@main
with:
directories: src
include: "**/*.ts"
output: repomix-output.txt
```

## Mehrere Verzeichnisse mit Komprimierung verpacken

Sie können mehrere Verzeichnisse, Include-/Exclude-Patterns und intelligente Komprimierung angeben:

```yaml
- name: Pack repository with Repomix
uses: yamadashy/repomix/.github/actions/repomix@main
with:
directories: src tests
include: "**/*.ts,**/*.md"
ignore: "**/*.test.ts"
output: repomix-output.txt
compress: true
```

## Ausgabedatei als Artefakt hochladen

Um die verpackte Datei für nachfolgende Schritte oder zum Download bereitzustellen, laden Sie sie als Artefakt hoch:

```yaml
- name: Pack repository with Repomix
uses: yamadashy/repomix/.github/actions/repomix@main
with:
directories: src
output: repomix-output.txt
compress: true

- name: Upload Repomix output
uses: actions/upload-artifact@v4
with:
name: repomix-output
path: repomix-output.txt
```

## Action-Eingabeparameter

| Name | Beschreibung | Standardwert |
|--------------------|----------------------------------------------|-------------------|
| `directories` | Zu verpackende Verzeichnisse (Leerzeichen-getrennt) | `.` |
| `include` | Einzuschließende Glob-Patterns (kommagetrennt) | `""` |
| `ignore` | Auszuschließende Glob-Patterns (kommagetrennt) | `""` |
| `output` | Pfad der Ausgabedatei | `repomix.txt` |
| `compress` | Intelligente Komprimierung aktivieren | `true` |
| `additional-args` | Zusätzliche Argumente für repomix CLI | `""` |
| `repomix-version` | Zu installierende npm-Paketversion | `latest` |

## Action-Ausgaben

| Name | Beschreibung |
|---------------|-------------------------------------|
| `output_file` | Pfad zur generierten Ausgabedatei |

## Komplettes Workflow-Beispiel

Hier ein vollständiges Beispiel für einen GitHub Actions Workflow mit Repomix:

```yaml
name: Pack and Upload Codebase
on:
push:
branches: [main]

jobs:
pack:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Pack repository with Repomix
uses: yamadashy/repomix/.github/actions/repomix@main
with:
directories: src
include: "**/*.ts"
output: repomix-output.txt
compress: true
- name: Upload Repomix output
uses: actions/upload-artifact@v4
with:
name: repomix-output
path: repomix-output.txt
```
Loading
Loading