Commit 0f9229d
committed
feat(workflows): add smart detection for script names vs commands in provenance workflow
Update setup-script, publish-script, and access-script to accept both:
- Script names (e.g., "ci:validate", "publish:ci") - automatically prefixed with "pnpm run"
- Commands (e.g., "pnpm run build", "npm publish --access public") - run as-is
Detection logic:
- If value contains spaces or shell operators (&&, ||, ;, |) -> run as command
- Otherwise -> treat as script name and prefix with "pnpm run"
- Trim whitespace from all inputs for safety
Benefits:
- Backward compatible with existing usage
- Supports both simple script names and complex commands
- Prevents argument parsing issues with shell operators
- More flexible for different publishing scenarios
Changes:
- Add whitespace trimming using xargs
- Add space/operator detection with regex
- Update input descriptions to document both patterns
- Apply to all three script inputs consistently1 parent 89c1d6d commit 0f9229d
1 file changed
+41
-8
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| |||
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
50 | | - | |
| 50 | + | |
51 | 51 | | |
52 | 52 | | |
53 | 53 | | |
| |||
67 | 67 | | |
68 | 68 | | |
69 | 69 | | |
70 | | - | |
| 70 | + | |
71 | 71 | | |
72 | 72 | | |
73 | 73 | | |
| |||
132 | 132 | | |
133 | 133 | | |
134 | 134 | | |
135 | | - | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
136 | 147 | | |
137 | 148 | | |
138 | 149 | | |
| |||
143 | 154 | | |
144 | 155 | | |
145 | 156 | | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
146 | 160 | | |
147 | 161 | | |
148 | 162 | | |
| |||
153 | 167 | | |
154 | 168 | | |
155 | 169 | | |
156 | | - | |
157 | | - | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
158 | 175 | | |
159 | | - | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
160 | 182 | | |
161 | 183 | | |
162 | 184 | | |
| |||
170 | 192 | | |
171 | 193 | | |
172 | 194 | | |
173 | | - | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
174 | 207 | | |
175 | 208 | | |
176 | 209 | | |
| |||
0 commit comments