Download .github/workflows/rust-release-prepare.yml from SaylorTwift/codex: direct link, hf CLI and curl.
- Browser
- Download file 1.82 kB
-
https://huggingface.co/SaylorTwift/codex/resolve/main/.github/workflows/rust-release-prepare.yml
- Command line
-
hf download hf://SaylorTwift/codex/.github/workflows/rust-release-prepare.yml
-
curl -L -o rust-release-prepare.yml https://huggingface.co/SaylorTwift/codex/resolve/main/.github/workflows/rust-release-prepare.yml
1.82 kB
| name: rust-release-prepare | |
| on: | |
| workflow_dispatch: | |
| schedule: | |
| - cron: "0 */4 * * *" | |
| concurrency: | |
| group: ${{ github.workflow }} | |
| cancel-in-progress: false | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| jobs: | |
| prepare: | |
| # Prevent scheduled runs on forks (no secrets, wastes Actions minutes) | |
| if: github.repository == 'openai/codex' | |
| environment: | |
| name: rust-release-prepare | |
| deployment: false | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| with: | |
| ref: main | |
| fetch-depth: 0 | |
| persist-credentials: false | |
| - name: Update models.json | |
| env: | |
| OPENAI_API_KEY: ${{ secrets.CODEX_OPENAI_API_KEY }} | |
| run: | | |
| set -euo pipefail | |
| client_version="99.99.99" | |
| terminal_info="github-actions" | |
| user_agent="codex_cli_rs/99.99.99 (Linux $(uname -r); $(uname -m)) ${terminal_info}" | |
| base_url="${OPENAI_BASE_URL:-https://chatgpt.com/backend-api/codex}" | |
| headers=( | |
| -H "Authorization: Bearer ${OPENAI_API_KEY}" | |
| -H "User-Agent: ${user_agent}" | |
| ) | |
| url="${base_url%/}/models?client_version=${client_version}" | |
| curl --http1.1 --fail --show-error --location "${headers[@]}" "${url}" | jq 'del(.models[].base_instructions)' > codex-rs/models-manager/models.json | |
| - name: Open pull request (if changed) | |
| uses: peter-evans/create-pull-request@c0f553fe549906ede9cf27b5156039d195d2ece0 # v8.1.0 | |
| with: | |
| commit-message: "Update models.json" | |
| title: "Update models.json" | |
| body: "Automated update of models.json." | |
| branch: "bot/update-models-json" | |
| reviewers: "pakrym-oai,aibrahim-oai" | |
| delete-branch: true | |