Repository navigation
Expand file tree
/
Copy pathaction.yml
More file actions
53 lines (50 loc) · 1.84 KB
/
Copy pathaction.yml
File metadata and controls
53 lines (50 loc) · 1.84 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
name: LLM Context Pack
description: Create a git-aware, token-budgeted, secret-redacted context file for coding agents.
author: dacode-dev
branding:
icon: package
color: blue
inputs:
path:
description: Repository path to pack.
required: false
default: .
since:
description: Optional git ref; only files changed since this ref are packed.
required: false
budget:
description: Optional maximum output token count.
required: false
model:
description: Optional model preset such as claude-sonnet or gpt-4o.
required: false
output:
description: Output Markdown path relative to the workspace.
required: false
default: context.md
outputs:
context-file:
description: Path of the generated Markdown context file.
value: ${{ steps.pack.outputs.context-file }}
runs:
using: composite
steps:
- id: pack
shell: bash
env:
INPUT_PATH: ${{ inputs.path }}
INPUT_SINCE: ${{ inputs.since }}
INPUT_BUDGET: ${{ inputs.budget }}
INPUT_MODEL: ${{ inputs.model }}
INPUT_OUTPUT: ${{ inputs.output }}
run: |
set -euo pipefail
args=("$INPUT_PATH")
if [[ -n "$INPUT_SINCE" ]]; then args+=(--since "$INPUT_SINCE"); fi
if [[ -n "$INPUT_BUDGET" ]]; then args+=(--budget "$INPUT_BUDGET"); fi
if [[ -n "$INPUT_MODEL" ]]; then args+=(--model "$INPUT_MODEL"); fi
mkdir -p "$(dirname -- "$INPUT_OUTPUT")"
install_dir="${RUNNER_TEMP:-${TMPDIR:-/tmp}}/llm-ctxpack-0.5.3-${GITHUB_RUN_ID:-local}-${GITHUB_RUN_ATTEMPT:-1}"
npm install --prefix "$install_dir" --no-save --ignore-scripts --no-audit --no-fund "llm-ctxpack@github:dacode-dev/llm-ctxpack#v0.5.3" >/dev/null
"$install_dir/node_modules/.bin/llm-ctxpack" "${args[@]}" --out "$INPUT_OUTPUT"
echo "context-file=$INPUT_OUTPUT" >> "$GITHUB_OUTPUT"