Skip to content

Commit 14d80c3

Browse files
authored
Add user_agent header (#8149)
add `user_agent` header and remove rust tool chain
1 parent 3a0d9bc commit 14d80c3

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

.github/workflows/rust-release-prepare.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,23 +21,24 @@ jobs:
2121
ref: main
2222
fetch-depth: 0
2323

24-
- uses: dtolnay/[email protected]
25-
2624
- name: Update models.json
2725
env:
2826
OPENAI_API_KEY: ${{ secrets.CODEX_OPENAI_API_KEY }}
2927
run: |
3028
set -euo pipefail
3129
3230
client_version="99.99.99"
31+
terminal_info="github-actions"
32+
user_agent="codex_cli_rs/99.99.99 (Linux $(uname -r); $(uname -m)) ${terminal_info}"
3333
base_url="${OPENAI_BASE_URL:-https://chatgpt.com/backend-api/codex}"
3434
3535
headers=(
3636
-H "Authorization: Bearer ${OPENAI_API_KEY}"
37+
-H "User-Agent: ${user_agent}"
3738
)
3839
3940
url="${base_url%/}/models?client_version=${client_version}"
40-
curl --fail --show-error --location "${headers[@]}" "${url}" | jq '.' > codex-rs/core/models.json
41+
curl --http1.1 --fail --show-error --location "${headers[@]}" "${url}" | jq '.' > codex-rs/core/models.json
4142
4243
- name: Open pull request (if changed)
4344
uses: peter-evans/create-pull-request@v7

0 commit comments

Comments
 (0)