Commit 4d3e0d3
committed
fix: Address critical security and logic issues in workflow
Fixes all issues identified in Claude Code review:
🚨 Critical Fixes:
1. Remove redundant condition in deploy-prod job
- Was checking github.event_name == 'release' twice
- Simplified to: !inputs.docker_only
2. Fix Docker job condition logic
- Removed flawed always() + needs dependency
- Now runs independently for release or manual triggers
- Docker builds don't require PyPI deployment success
🔐 Security Improvements:
3. Add tag format validation
- Validates semver format: v1.2.3 or v1.2.3-alpha
- Prevents arbitrary git ref injection
4. Add tag existence verification
- Verifies tag exists before building
- Provides clear error messages
🔧 Best Practice Improvements:
5. Normalize tag value extraction
- Creates normalized tag output for metadata
- Handles both release and manual trigger sources
6. Remove needs dependency from docker job
- Docker builds are independent of PyPI
- Allows manual Docker-only builds without test deploy
All changes maintain backward compatibility with release events
while enabling secure manual Docker builds.1 parent 0b8e3b1 commit 4d3e0d3
1 file changed
+34
-8
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
58 | | - | |
| 58 | + | |
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
| |||
83 | 83 | | |
84 | 84 | | |
85 | 85 | | |
86 | | - | |
87 | | - | |
| 86 | + | |
| 87 | + | |
88 | 88 | | |
89 | 89 | | |
90 | 90 | | |
| |||
93 | 93 | | |
94 | 94 | | |
95 | 95 | | |
96 | | - | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
97 | 123 | | |
98 | 124 | | |
99 | 125 | | |
| |||
105 | 131 | | |
106 | 132 | | |
107 | 133 | | |
108 | | - | |
| 134 | + | |
109 | 135 | | |
110 | 136 | | |
111 | 137 | | |
| |||
124 | 150 | | |
125 | 151 | | |
126 | 152 | | |
127 | | - | |
| 153 | + | |
128 | 154 | | |
129 | | - | |
| 155 | + | |
130 | 156 | | |
131 | | - | |
| 157 | + | |
132 | 158 | | |
133 | 159 | | |
134 | 160 | | |
| |||
0 commit comments