@@ -48,46 +48,47 @@ jobs:
4848 uses : actions/github-script@v6
4949 with :
5050 script : |
51- # this doesn't restrict to a particular workflow run, but the
52- # artifacts we're looking for will only be built from a scheduled
53- # (cron) run, and not from pull requests
54- let allArtifacts = await github.rest.actions.listWorkflowRunArtifacts({
51+ // this doesn't restrict to a particular workflow run, but the
52+ // artifacts we're looking for will only be built from a scheduled
53+ // (cron) run, and not from pull requests
54+ let allArtifacts =
55+ await github.rest.actions.listWorkflowRunArtifacts({
5556 owner: context.repo.owner,
5657 repo: context.repo.repo,
5758 });
58- # # keep first artifact named u-boot-rb1-links and linux-deb-links
59- # let u_boot_rb1 = allArtifacts.data.artifacts.filter((artifact) => {
60- # return artifact.name == "u-boot-rb1-links"
61- # })[0];
62- # let linux_deb = allArtifacts.data.artifacts.filter((artifact) => {
63- # return artifact.name == "linux-deb-links"
64- # })[0];
65- # # download both in memory
66- # let linux_deb_dl =
67- # await github.rest.actions.downloadArtifact({
68- # owner: context.repo.owner,
69- # repo: context.repo.repo,
70- # artifact_id: linux_deb.id,
71- # archive_format: 'zip',
72- # });
73- # let u_boot_rb1_dl =
74- # await github.rest.actions.downloadArtifact({
75- # owner: context.repo.owner,
76- # repo: context.repo.repo,
77- # artifact_id: u_boot_rb1.id,
78- # archive_format: 'zip',
79- # });
80- # # write files under temp dir
81- # const fs = require('fs');
82- # const path = require('path');
83- # const temp = '${{ runner.temp }}/artifacts';
84- # if (!fs.existsSync(temp)){
85- # fs.mkdirSync(temp);
86- # }
87- # fs.writeFileSync(path.join(temp, 'linux_deb_links.zip'),
88- # Buffer.from(linux_deb_dl.data));
89- # fs.writeFileSync(path.join(temp, 'u_boot_rb1_links.zip'),
90- # Buffer.from(u_boot_rb1_dl.data));
59+ // keep first artifact named u-boot-rb1-links and linux-deb-links
60+ let u_boot_rb1 = allArtifacts.data.artifacts.filter((artifact) => {
61+ return artifact.name == "u-boot-rb1-links"
62+ })[0];
63+ let linux_deb = allArtifacts.data.artifacts.filter((artifact) => {
64+ return artifact.name == "linux-deb-links"
65+ })[0];
66+ // download both in memory
67+ let linux_deb_dl =
68+ await github.rest.actions.downloadArtifact({
69+ owner: context.repo.owner,
70+ repo: context.repo.repo,
71+ artifact_id: linux_deb.id,
72+ archive_format: 'zip',
73+ });
74+ let u_boot_rb1_dl =
75+ await github.rest.actions.downloadArtifact({
76+ owner: context.repo.owner,
77+ repo: context.repo.repo,
78+ artifact_id: u_boot_rb1.id,
79+ archive_format: 'zip',
80+ });
81+ // write files under temp dir
82+ const fs = require('fs');
83+ const path = require('path');
84+ const temp = '${{ runner.temp }}/artifacts';
85+ if (!fs.existsSync(temp)){
86+ fs.mkdirSync(temp);
87+ }
88+ fs.writeFileSync(path.join(temp, 'linux_deb_links.zip'),
89+ Buffer.from(linux_deb_dl.data));
90+ fs.writeFileSync(path.join(temp, 'u_boot_rb1_links.zip'),
91+ Buffer.from(u_boot_rb1_dl.data));
9192
9293 # make sure we have latest packages first, to get latest fixes and to
9394 # avoid an automated update while we're building
0 commit comments