File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2020 - name : Checkout repository
2121 uses : actions/checkout@v3
2222
23- - name : Test OpenHands AI Action
24- id : openhands
23+ - name : Test OpenHands AI Action with valid API key
24+ id : openhands_valid
2525 uses : ./
2626 with :
2727 prompt : " What is 2+2?"
@@ -32,19 +32,34 @@ jobs:
3232 "TEST_VAR": "test_value"
3333 }
3434
35- - name : Verify outputs
35+ - name : Verify outputs with valid API key
3636 run : |
37- echo "Task ID: ${{ steps.openhands .outputs.task_id }}"
38- echo "Status: ${{ steps.openhands .outputs.status }}"
39- echo "Result: ${{ steps.openhands .outputs.result }}"
37+ echo "Task ID: ${{ steps.openhands_valid .outputs.task_id }}"
38+ echo "Status: ${{ steps.openhands_valid .outputs.status }}"
39+ echo "Result: ${{ steps.openhands_valid .outputs.result }}"
4040
4141 # Basic validation of outputs
42- if [ -z "${{ steps.openhands .outputs.task_id }}" ]; then
42+ if [ -z "${{ steps.openhands_valid .outputs.task_id }}" ]; then
4343 echo "Error: Task ID is empty"
4444 exit 1
4545 fi
4646
47- if [ -z "${{ steps.openhands .outputs.status }}" ]; then
47+ if [ -z "${{ steps.openhands_valid .outputs.status }}" ]; then
4848 echo "Error: Status is empty"
4949 exit 1
50+ fi
51+
52+ - name : Test OpenHands AI Action without API key
53+ id : openhands_invalid
54+ continue-on-error : true
55+ uses : ./
56+ with :
57+ prompt : " What is 2+2?"
58+ log_all_events : " true"
59+
60+ - name : Verify error without API key
61+ run : |
62+ if [ "${{ steps.openhands_invalid.outcome }}" != "failure" ]; then
63+ echo "Error: Action should have failed without API key"
64+ exit 1
5065 fi
Original file line number Diff line number Diff line change 5757 - name : Set up Docker
5858 uses : docker/setup-buildx-action@v2
5959
60+ - name : Validate LLM API Key
61+ shell : bash
62+ run : |
63+ if [ -z "${{ inputs.llm_api_key }}" ]; then
64+ echo "::error::LLM_API_KEY is required but not provided"
65+ exit 1
66+ fi
67+
6068 - name : Run OpenHands
6169 id : openhands
6270 shell : bash
You can’t perform that action at this time.
0 commit comments