Skip to content

Commit 050d1c4

Browse files
committed
Implement artifact filter for workflow artifact action
1 parent ec2e3c7 commit 050d1c4

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

scripts/release/update-release-assets.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,8 +169,12 @@ def run(self) -> List[Path]:
169169
workflow_runs = [workflow_run for workflow_run in self.workflow_runs if not re.match(self.kwargs["not-name"], workflow_run.name)]
170170
print(f"Downloading the artifacts for {len(workflow_runs)} workflow runs")
171171
for workflow_run in workflow_runs:
172-
print(f"Downloading artifacts for {workflow_run.name} to {self.temp_workdir.name}")
173-
workflow_run.download_artifacts(Path(self.temp_workdir.name)) # type: ignore
172+
if "artifact" in self.kwargs:
173+
print(f"Downloading artifact {self.kwargs['artifact']} for {workflow_run.name} to {self.temp_workdir.name}")
174+
workflow_run.download_artifact(self.kwargs["artifact"], Path(self.temp_workdir.name)) # type: ignore
175+
else:
176+
print(f"Downloading artifacts for {workflow_run.name} to {self.temp_workdir.name}")
177+
workflow_run.download_artifacts(Path(self.temp_workdir.name)) # type: ignore
174178
return list(map(Path, Path(self.temp_workdir.name).glob("**/*")))
175179

176180
class ShellAction():

0 commit comments

Comments
 (0)