github-actions.mdโข3.83 kB
# GitHub Actions์์ Repomix ์ฌ์ฉํ๊ธฐ
GitHub Actions ์ํฌํ๋ก์ฐ์ Repomix๋ฅผ ํตํฉํ๋ฉด AI ๋ถ์์ ์ํ ์ฝ๋๋ฒ ์ด์ค ํจํน์ ์๋ํํ ์ ์์ต๋๋ค. ์ด๋ CI, ์ฝ๋ ๋ฆฌ๋ทฐ, LLM ๋๊ตฌ ์ค๋น ๋ฑ์ ์ ์ฉํฉ๋๋ค.
## ๊ธฐ๋ณธ ์ฌ์ฉ๋ฒ
๋ค์ ์คํ
์ ์ํฌํ๋ก์ฐ YAML์ ์ถ๊ฐํ์ฌ ์ ์ฅ์๋ฅผ ํจํนํ ์ ์์ต๋๋ค.
```yaml
- name: Pack repository with Repomix
uses: yamadashy/repomix/.github/actions/repomix@main
with:
output: repomix-output.xml
```
## ๋ค์ํ ์ถ๋ ฅ ํ์ ์ฌ์ฉํ๊ธฐ
`style` ๋งค๊ฐ๋ณ์๋ฅผ ์ฌ์ฉํ์ฌ ๋ค์ํ ์ถ๋ ฅ ํ์์ ์ง์ ํ ์ ์์ต๋๋ค(๊ธฐ๋ณธ๊ฐ์ `xml`):
```yaml
- name: Pack repository with Repomix
uses: yamadashy/repomix/.github/actions/repomix@main
with:
output: repomix-output.md
style: markdown
```
```yaml
- name: Pack repository with Repomix (JSON format)
uses: yamadashy/repomix/.github/actions/repomix@main
with:
output: repomix-output.json
style: json
```
## ์ฌ๋ฌ ๋๋ ํฐ๋ฆฌ ๋ฐ ์์ถ ์ต์
์ฌ๋ฌ ๋๋ ํฐ๋ฆฌ, include/exclude ํจํด, ์ค๋งํธ ์์ถ๋ ์ง์ ํ ์ ์์ต๋๋ค.
```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
```
## ์ถ๋ ฅ ํ์ผ์ ์ํฐํฉํธ๋ก ์
๋ก๋
์์ฑ๋ ํ์ผ์ ํ์ ์คํ
์ด๋ ๋ค์ด๋ก๋์ฉ์ผ๋ก ์
๋ก๋ํ๋ ์์์
๋๋ค.
```yaml
- name: Pack repository with Repomix
uses: yamadashy/repomix/.github/actions/repomix@main
with:
directories: src
output: repomix-output.xml
compress: true
- name: Upload Repomix output
uses: actions/upload-artifact@v4
with:
name: repomix-output
path: repomix-output.xml
```
## Action ์
๋ ฅ ํ๋ผ๋ฏธํฐ
| ์ด๋ฆ | ์ค๋ช
| ๊ธฐ๋ณธ๊ฐ |
|---------------------|----------------------------------------|------------------|
| `directories` | ํจํนํ ๋๋ ํฐ๋ฆฌ(๊ณต๋ฐฑ ๊ตฌ๋ถ) | `.` |
| `include` | ํฌํจํ glob ํจํด(์ผํ ๊ตฌ๋ถ) | `""` |
| `ignore` | ์ ์ธํ glob ํจํด(์ผํ ๊ตฌ๋ถ) | `""` |
| `output` | ์ถ๋ ฅ ํ์ผ ๊ฒฝ๋ก | `repomix-output.xml` |
| `style` | ์ถ๋ ฅ ์คํ์ผ (xml, markdown, json, plain) | `xml` |
| `compress` | ์ค๋งํธ ์์ถ ํ์ฑํ | `true` |
| `additional-args` | repomix CLI์ ์ ๋ฌํ ์ถ๊ฐ ์ธ์ | `""` |
| `repomix-version` | ์ค์นํ npm ํจํค์ง ๋ฒ์ | `latest` |
## Action ์ถ๋ ฅ
| ์ด๋ฆ | ์ค๋ช
|
|----------------|------------------------|
| `output_file` | ์์ฑ๋ ์ถ๋ ฅ ํ์ผ ๊ฒฝ๋ก |
## ์ ์ฒด ์ํฌํ๋ก์ฐ ์์
Repomix๋ฅผ ์ฌ์ฉํ๋ GitHub Actions ์ํฌํ๋ก์ฐ ์ ์ฒด ์์์
๋๋ค.
```yaml
name: Pack repository with Repomix
on:
workflow_dispatch:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
pack-repo:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Pack repository with Repomix
uses: yamadashy/repomix/.github/actions/repomix@main
with:
output: repomix-output.xml
- name: Upload Repomix output
uses: actions/upload-artifact@v4
with:
name: repomix-output.xml
path: repomix-output.xml
retention-days: 30
```
[์ ์ฒด ์ํฌํ๋ก์ฐ ์์](https://github.com/yamadashy/repomix/blob/main/.github/workflows/pack-repository.yml)๋ฅผ ํ์ธํ ์ ์์ต๋๋ค.