codex-action  by openai

GitHub Actions integration for secure AI code analysis

Created 3 months ago
749 stars

Top 46.4% on SourcePulse

GitHubView on GitHub
Project Summary

Summary

This GitHub Action enables running the OpenAI Codex CLI directly within GitHub Actions workflows, offering fine-grained control over Codex's execution privileges. It's designed for developers seeking to automate code analysis, review, or generation tasks as part of their CI/CD pipelines, providing a secure and customizable integration.

How It Works

The action installs the Codex CLI and sets up a secure proxy to the OpenAI API. It requires an OPENAI_API_KEY secret and integrates with standard GitHub Actions checkout steps. A key feature is the safety-strategy input, which allows users to restrict Codex's access to the runner environment, ranging from read-only to full access, enhancing security.

Quick Start & Requirements

  • Primary Command: Use uses: openai/codex-action@v1 in your GitHub Actions workflow YAML.
  • Prerequisites:
    • OPENAI_API_KEY stored as a GitHub Actions secret.
    • actions/checkout@v5 must be run prior to this action.
  • Dependencies: None beyond the action and API key.
  • OS Support: Linux/macOS support all safety-strategy options. Windows runners require safety-strategy: unsafe.
  • Links: Refer to security.md for detailed security practices (not provided).

Highlighted Details

  • Privilege Control: Robust safety-strategy options (drop-sudo, unprivileged-user, read-only, unsafe) to mitigate security risks.
  • Customization: Supports inline prompts or prompt files, allowing tailored code analysis tasks.
  • Workflow Integration: Designed to seamlessly integrate into CI/CD, with examples showing PR comment generation.
  • CLI Access: Can install and configure the Codex CLI for subsequent use within the same job.

Maintenance & Community

No specific details on contributors, community channels, or roadmap were provided in the README snippet.

Licensing & Compatibility

  • License: Apache License 2.0.
  • Compatibility: Permissive license suitable for commercial use and integration into closed-source projects.

Limitations & Caveats

Windows runners have limited safety-strategy options, defaulting to unsafe. The drop-sudo strategy impacts subsequent steps in the same job that require superuser privileges. Network access is disabled by default in the sandbox, necessitating pre-downloading dependencies for code execution tasks. Careful management of the OPENAI_API_KEY and selection of safety-strategy are critical for security.

Health Check
Last Commit

1 month ago

Responsiveness

Inactive

Pull Requests (30d)
1
Issues (30d)
0
Star History
34 stars in the last 30 days

Explore Similar Projects

Starred by Chip Huyen Chip Huyen(Author of "AI Engineering", "Designing Machine Learning Systems").

codegate by stacklok

0%
709
AI agent security and management tool
Created 1 year ago
Updated 7 months ago
Feedback? Help us improve.