@@ -155,71 +155,54 @@ class ActionsGitHubScriptDownloadStep extends UntrustedArtifactDownloadStep, Use
155155 }
156156
157157 override string getPath ( ) {
158- if
159- this .getAFollowingStep ( )
160- .( Run )
161- .getScript ( )
162- .splitAt ( "\n" )
163- .regexpMatch ( unzipRegexp ( ) + unzipDirArgRegexp ( ) )
158+ if this .getAFollowingStep ( ) .( Run ) .getACommand ( ) .regexpMatch ( unzipRegexp ( ) + unzipDirArgRegexp ( ) )
164159 then
165160 result =
166161 normalizePath ( trimQuotes ( this .getAFollowingStep ( )
167162 .( Run )
168- .getScript ( )
169- .splitAt ( "\n" )
163+ .getACommand ( )
170164 .regexpCapture ( unzipRegexp ( ) + unzipDirArgRegexp ( ) , 2 ) ) )
171165 else
172- if this .getAFollowingStep ( ) .( Run ) .getScript ( ) . splitAt ( "\n" ) .regexpMatch ( unzipRegexp ( ) )
166+ if this .getAFollowingStep ( ) .( Run ) .getACommand ( ) .regexpMatch ( unzipRegexp ( ) )
173167 then result = "GITHUB_WORKSPACE/"
174168 else none ( )
175169 }
176170}
177171
178172class GHRunArtifactDownloadStep extends UntrustedArtifactDownloadStep , Run {
179- string script ;
180-
181173 GHRunArtifactDownloadStep ( ) {
182174 // eg: - run: gh run download ${{ github.event.workflow_run.id }} --repo "${GITHUB_REPOSITORY}" --name "artifact_name"
183- this .getScript ( ) = script and
184- script .splitAt ( "\n" ) .regexpMatch ( ".*gh\\s+run\\s+download.*" ) and
185- script .splitAt ( "\n" ) .matches ( "%github.event.workflow_run.id%" ) and
175+ this .getACommand ( ) .regexpMatch ( ".*gh\\s+run\\s+download.*" ) and
176+ this .getACommand ( ) .matches ( "%github.event.workflow_run.id%" ) and
186177 (
187- script . splitAt ( "\n" ) .regexpMatch ( unzipRegexp ( ) ) or
188- this .getAFollowingStep ( ) .( Run ) .getScript ( ) . splitAt ( "\n" ) .regexpMatch ( unzipRegexp ( ) )
178+ this . getACommand ( ) .regexpMatch ( unzipRegexp ( ) ) or
179+ this .getAFollowingStep ( ) .( Run ) .getACommand ( ) .regexpMatch ( unzipRegexp ( ) )
189180 )
190181 }
191182
192183 override string getPath ( ) {
193184 if
194- this .getAFollowingStep ( )
195- .( Run )
196- .getScript ( )
197- .splitAt ( "\n" )
198- .regexpMatch ( unzipRegexp ( ) + unzipDirArgRegexp ( ) ) or
199- script .splitAt ( "\n" ) .regexpMatch ( unzipRegexp ( ) + unzipDirArgRegexp ( ) )
185+ this .getAFollowingStep ( ) .( Run ) .getACommand ( ) .regexpMatch ( unzipRegexp ( ) + unzipDirArgRegexp ( ) ) or
186+ this .getACommand ( ) .regexpMatch ( unzipRegexp ( ) + unzipDirArgRegexp ( ) )
200187 then
201188 result =
202- normalizePath ( trimQuotes ( script
203- .splitAt ( "\n" )
189+ normalizePath ( trimQuotes ( this .getACommand ( )
204190 .regexpCapture ( unzipRegexp ( ) + unzipDirArgRegexp ( ) , 2 ) ) ) or
205191 result =
206192 normalizePath ( trimQuotes ( this .getAFollowingStep ( )
207193 .( Run )
208- .getScript ( )
209- .splitAt ( "\n" )
194+ .getACommand ( )
210195 .regexpCapture ( unzipRegexp ( ) + unzipDirArgRegexp ( ) , 2 ) ) )
211196 else
212197 if
213- this .getAFollowingStep ( ) .( Run ) .getScript ( ) . splitAt ( "\n" ) .regexpMatch ( unzipRegexp ( ) ) or
214- script . splitAt ( "\n" ) .regexpMatch ( unzipRegexp ( ) )
198+ this .getAFollowingStep ( ) .( Run ) .getACommand ( ) .regexpMatch ( unzipRegexp ( ) ) or
199+ this . getACommand ( ) .regexpMatch ( unzipRegexp ( ) )
215200 then result = "GITHUB_WORKSPACE/"
216201 else none ( )
217202 }
218203}
219204
220205class DirectArtifactDownloadStep extends UntrustedArtifactDownloadStep , Run {
221- string script ;
222-
223206 DirectArtifactDownloadStep ( ) {
224207 // eg:
225208 // run: |
@@ -230,32 +213,25 @@ class DirectArtifactDownloadStep extends UntrustedArtifactDownloadStep, Run {
230213 // gh api $url > "$name.zip"
231214 // unzip -d "$name" "$name.zip"
232215 // done
233- this .getScript ( ) = script and
234- script .splitAt ( "\n" ) .matches ( "%github.event.workflow_run.artifacts_url%" ) and
216+ this .getACommand ( ) .matches ( "%github.event.workflow_run.artifacts_url%" ) and
235217 (
236- script . splitAt ( "\n" ) .regexpMatch ( unzipRegexp ( ) ) or
237- this .getAFollowingStep ( ) .( Run ) .getScript ( ) . splitAt ( "\n" ) .regexpMatch ( unzipRegexp ( ) )
218+ this . getACommand ( ) .regexpMatch ( unzipRegexp ( ) ) or
219+ this .getAFollowingStep ( ) .( Run ) .getACommand ( ) .regexpMatch ( unzipRegexp ( ) )
238220 )
239221 }
240222
241223 override string getPath ( ) {
242224 if
243- script .splitAt ( "\n" ) .regexpMatch ( unzipRegexp ( ) + unzipDirArgRegexp ( ) ) or
244- this .getAFollowingStep ( )
245- .( Run )
246- .getScript ( )
247- .splitAt ( "\n" )
248- .regexpMatch ( unzipRegexp ( ) + unzipDirArgRegexp ( ) )
225+ this .getACommand ( ) .regexpMatch ( unzipRegexp ( ) + unzipDirArgRegexp ( ) ) or
226+ this .getAFollowingStep ( ) .( Run ) .getACommand ( ) .regexpMatch ( unzipRegexp ( ) + unzipDirArgRegexp ( ) )
249227 then
250228 result =
251- normalizePath ( trimQuotes ( script
252- .splitAt ( "\n" )
229+ normalizePath ( trimQuotes ( this .getACommand ( )
253230 .regexpCapture ( unzipRegexp ( ) + unzipDirArgRegexp ( ) , 2 ) ) ) or
254231 result =
255232 normalizePath ( trimQuotes ( this .getAFollowingStep ( )
256233 .( Run )
257- .getScript ( )
258- .splitAt ( "\n" )
234+ .getACommand ( )
259235 .regexpCapture ( unzipRegexp ( ) + unzipDirArgRegexp ( ) , 2 ) ) )
260236 else result = "GITHUB_WORKSPACE/"
261237 }
0 commit comments