Commit 25f5be6
committed
Address security and portability issues in CI scripts
1. Security: Remove eval from bin/ci-run-failed-specs
- Use bash array instead of string for RSPEC_CMD
- Execute command directly with "${RSPEC_CMD[@]}" (safer)
- Eliminates command injection risk from spec paths
2. Security: Document safe eval usage in bin/ci-rerun-failures
- Add comment explaining eval is safe (commands from predefined JOB_MAP)
- Fix REPLY variable to use explicit naming
3. Error handling: Add dependency checks
- bin/ci-rerun-failures: Check for gh and jq
- bin/ci-run-failed-specs: Check for bundle
- Provide clear error messages with install instructions
4. Portability: Document cross-platform clipboard alternatives
- Add Linux alternatives (xclip, wl-clipboard) in CLAUDE.md
- Maintain pbpaste as primary example for macOS
5. Consistency: Fix REPLY variable handling
- Explicitly name REPLY in all read commands
- Use ${REPLY} with quotes for -u compatibility
All scripts now have consistent error handling, better security,
and clearer documentation for cross-platform usage.1 parent efdd6fd commit 25f5be6
3 files changed
+52
-12
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
100 | 100 | | |
101 | 101 | | |
102 | 102 | | |
103 | | - | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
104 | 106 | | |
105 | 107 | | |
106 | 108 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
71 | 71 | | |
72 | 72 | | |
73 | 73 | | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
74 | 90 | | |
75 | 91 | | |
76 | 92 | | |
| |||
214 | 230 | | |
215 | 231 | | |
216 | 232 | | |
217 | | - | |
| 233 | + | |
218 | 234 | | |
219 | | - | |
| 235 | + | |
220 | 236 | | |
221 | 237 | | |
222 | 238 | | |
| |||
239 | 255 | | |
240 | 256 | | |
241 | 257 | | |
| 258 | + | |
| 259 | + | |
242 | 260 | | |
243 | 261 | | |
244 | 262 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
21 | 36 | | |
22 | 37 | | |
23 | 38 | | |
| |||
122 | 137 | | |
123 | 138 | | |
124 | 139 | | |
125 | | - | |
126 | | - | |
| 140 | + | |
| 141 | + | |
127 | 142 | | |
128 | | - | |
| 143 | + | |
129 | 144 | | |
130 | 145 | | |
131 | | - | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
132 | 152 | | |
133 | 153 | | |
134 | 154 | | |
135 | 155 | | |
136 | | - | |
| 156 | + | |
137 | 157 | | |
138 | | - | |
| 158 | + | |
139 | 159 | | |
140 | 160 | | |
141 | | - | |
| 161 | + | |
142 | 162 | | |
143 | 163 | | |
144 | 164 | | |
145 | 165 | | |
146 | | - | |
| 166 | + | |
147 | 167 | | |
148 | | - | |
| 168 | + | |
149 | 169 | | |
150 | 170 | | |
151 | 171 | | |
| |||
0 commit comments