File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -32,22 +32,24 @@ runs:
3232 shell : bash
3333 env :
3434 API_VERSION : ${{ inputs.github-api-version }}
35- GH_HOST : ${{ github.server_url }}
3635 GH_TOKEN : ${{ inputs.github-token }}
3736 ORG : ${{ inputs.org != '' && format('orgs/{0}/', inputs.org) || '' }}
3837 run : |
39- GH_HOST=$(echo $GH_HOST | sed 's/.*:\/\///')
38+ GH_HOST=$(echo $GITHUB_SERVER_URL | sed 's/.*:\/\///')
4039
4140 response_raw=$(curl --request POST --location https://models.github.ai/${ORG}inference/chat/completions \
4241 --header "Accept: application/vnd.github+json" \
4342 --header "Authorization: Bearer $GH_TOKEN" \
4443 --header "Content-Type: application/json" \
4544 --header "X-GitHub-Api-Version: $API_VERSION" \
4645 --data '{
47- "messages": '"${{ inputs.messages }}" ',
48- "model": ' "${{ inputs.model }}"'
49- }')
46+ "messages": '[{"role": "user", "content": "Hello!"}] ',
47+ "model": "${{ inputs.model }}"
48+ }')
5049
50+ # "messages": '"${{ inputs.messages }}"',
51+ # "model": '"${{ inputs.model }}"'
52+ echo $response_raw
5153 echo "response_raw=$response_raw" >> $GITHUB_OUTPUT
5254 echo "response=$response_raw | jq --raw-output '.choices[0].message.content'" >> $GITHUB_OUTPUT
5355
You can’t perform that action at this time.
0 commit comments