Skip to content

Commit b0f0ba9

Browse files
authored
Implement producing output from action run (#16)
Add output for gemini cli run result
1 parent df79204 commit b0f0ba9

2 files changed

Lines changed: 17 additions & 5 deletions

File tree

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,8 @@ environment variables, and secrets.
6767

6868
<!-- BEGIN_AUTOGEN_OUTPUTS -->
6969

70+
- `summary`: The summarized output from the Gemini CLI execution.
71+
7072

7173
<!-- END_AUTOGEN_OUTPUTS -->
7274

action.yml

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,11 @@ inputs:
2828
.gemini/settings.json.
2929
required: false
3030

31+
outputs:
32+
summary:
33+
description: 'The summarized output from the Gemini CLI execution.'
34+
value: '${{ steps.gemini_run.outputs.gemini_response }}'
35+
3136
runs:
3237
using: 'composite'
3338
steps:
@@ -94,15 +99,20 @@ runs:
9499
fi
95100
96101
- name: 'Run Gemini CLI'
102+
id: 'gemini_run'
103+
run: |
104+
set -e
105+
GEMINI_RESPONSE=$(gemini --yolo --prompt "${PROMPT}")
106+
# Set the captured response as a step output, supporting multiline
107+
echo "gemini_response<<EOF" >> "${GITHUB_OUTPUT}"
108+
echo "${GEMINI_RESPONSE}" >> "${GITHUB_OUTPUT}"
109+
echo "EOF" >> "${GITHUB_OUTPUT}"
110+
echo "${GEMINI_RESPONSE}"
111+
shell: 'bash'
97112
env:
98113
GEMINI_API_KEY: '${{ env.GEMINI_API_KEY }}'
99114
SURFACE: 'GitHub'
100115
PROMPT: '${{ inputs.prompt }}'
101-
shell: 'bash'
102-
run: |
103-
gemini --yolo --prompt "${PROMPT}"
104-
105-
outputs: {}
106116

107117
branding:
108118
icon: 'terminal'

0 commit comments

Comments
 (0)