Files
Pygentic-AI/.github/workflows
Francis Secada 3322e6079a feat(ci): dynamic secret injection using custom action
BREAKING: Replaces explicit env var declarations with dynamic approach

Changes:
- Created .github/actions/setup-env custom action
- Uses toJSON(secrets) to pass ALL repository secrets dynamically
- Generates .env file automatically from secrets
- No need to update workflow when adding new secrets

How It Works:
1. toJSON(secrets) serializes all secrets to JSON
2. Custom action parses JSON with jq
3. Writes all secrets to .env file
4. Application loads .env via python-decouple/python-dotenv

Benefits:
-  Fully dynamic - new secrets auto-included
-  DRY - no repetitive secret declarations
-  Maintainable - add secrets via 'gh secret set' only
-  Secure - secrets never in workflow YAML
-  Transparent - .env approach matches local dev

Usage:
  gh secret set NEW_SECRET --body "value"
  # Automatically available in next CI run!

Before:
  30+ lines of explicit env: declarations

After:
  3 lines with toJSON(secrets)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-04 16:25:42 -05:00
..