-
Notifications
You must be signed in to change notification settings - Fork 0
104 lines (94 loc) · 3.5 KB
/
Copy pathagent-workflow.yml
File metadata and controls
104 lines (94 loc) · 3.5 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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
# ======================================================================
# L3 Agent Workflow — construct-coordination
# ======================================================================
# Trigger construct-coordination as an L3 agent via GitHub Actions.
# This repo is coordination/documentation — no build step needed.
# ======================================================================
name: Agent Task (Level-3)
on:
workflow_dispatch:
inputs:
agent_task:
description: 'Task for the agent to execute'
required: true
default: 'ls notes/'
type: string
agent_model:
description: 'Model to use'
required: false
default: 'deepseek-ai/DeepSeek-V4-Flash'
type: string
output_format:
description: 'Output format'
required: false
default: 'markdown'
type: choice
options:
- markdown
- json
- yaml
commit_results:
description: 'Commit results back to repo?'
required: false
default: 'true'
type: choice
options:
- 'true'
- 'false'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
DEEPINFRA_API_KEY: ${{ secrets.DEEPINFRA_API_KEY }}
DEEPINFRA_API_URL: https://api.deepinfra.com/v1
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
jobs:
execute-agent-task:
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Agent Identity
run: |
echo "::group::Agent Identity"
echo "Repo: ${{ github.repository }}"
echo "Agent: construct-coordination (L3)"
echo "Task: ${{ github.event.inputs.agent_task }}"
echo "Run ID: ${{ github.run_id }}"
echo "::endgroup::"
- name: Execute Agent Task
id: execute
run: |
echo "::group::Agent Task Output"
mkdir -p agent-output
OUTPUT_FILE="agent-output/result.${{ github.event.inputs.output_format == 'markdown' && 'md' || github.event.inputs.output_format }}"
eval '${{ github.event.inputs.agent_task }}' 2>&1 | tee "$OUTPUT_FILE"
echo "::endgroup::"
- name: Commit Results
if: ${{ github.event.inputs.commit_results == 'true' }}
run: |
git config user.name "agent-bot"
git config user.email "agent-bot@users.noreply.github.com"
git add -A
if ! git diff --cached --quiet; then
git commit -m "agent: ${{ github.event.inputs.agent_task }} [skip ci]"
git push origin HEAD:${{ github.ref_name }}
else
echo "No changes to commit."
fi
- name: Upload Agent Output
uses: actions/upload-artifact@v4
with:
name: agent-output
path: agent-output/
retention-days: 7
- name: Summary
run: |
echo "## Agent Task Complete — construct-coordination" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "| Field | Value |" >> $GITHUB_STEP_SUMMARY
echo "|---|---|" >> $GITHUB_STEP_SUMMARY
echo "| **Task** | ${{ github.event.inputs.agent_task }} |" >> $GITHUB_STEP_SUMMARY
echo "| **Model** | ${{ github.event.inputs.agent_model }} |" >> $GITHUB_STEP_SUMMARY
echo "| **Run ID** | ${{ github.run_id }} |" >> $GITHUB_STEP_SUMMARY
echo "| **Committed** | ${{ github.event.inputs.commit_results }} |" >> $GITHUB_STEP_SUMMARY