Skip to content

Commit bbf2fa4

Browse files
committed
Simplify JS
1 parent daab2ed commit bbf2fa4

File tree

1 file changed

+12
-33
lines changed

1 file changed

+12
-33
lines changed

.github/workflows/debos.yml

Lines changed: 12 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -52,54 +52,33 @@ jobs:
5252
// (not particularly for this workflow run; artifacts we're looking
5353
// for will only be built from a scheduled (cron) run, and not from
5454
// pull requests)
55-
let response =
55+
let linux_deb_url = (
5656
await github.rest.actions.listArtifactsForRepo({
5757
owner: context.repo.owner,
5858
repo: context.repo.repo,
59-
name: "u-boot-rb1-links",
59+
name: "linux-deb-links",
6060
page: 1,
6161
per_page: 1,
62-
});
63-
64-
console.log("Response2:", JSON.stringify(response, null, 2));
62+
})
63+
).data.artifacts[0].archive_download_url;
6564
66-
let u_boot_rb1 = response.data.artifacts[0];
67-
let linux_deb =
68-
(await github.rest.actions.listArtifactsForRepo({
65+
let u_boot_rb1_url = (
66+
await github.rest.actions.listArtifactsForRepo({
6967
owner: context.repo.owner,
7068
repo: context.repo.repo,
71-
name: "linux-deb-links",
69+
name: "u-boot-rb1-links",
7270
page: 1,
7371
per_page: 1,
74-
})).data.artifacts[0];
75-
console.log("Response3:", JSON.stringify(linux_deb, null, 2));
76-
console.log("id:", JSON.stringify(linux_deb.id, null, 2));
77-
// download both in memory
78-
let linux_deb_dl =
79-
await github.rest.actions.downloadArtifact({
80-
owner: context.repo.owner,
81-
repo: context.repo.repo,
82-
artifact_id: linux_deb.id,
83-
archive_format: 'zip',
84-
});
85-
let u_boot_rb1_dl =
86-
await github.rest.actions.downloadArtifact({
87-
owner: context.repo.owner,
88-
repo: context.repo.repo,
89-
artifact_id: u_boot_rb1.id,
90-
archive_format: 'zip',
91-
});
72+
})
73+
).data.artifacts[0].archive_download_url;
74+
9275
// write files under temp dir
9376
const fs = require('fs');
9477
const path = require('path');
95-
const temp = '${{ runner.temp }}/artifacts';
96-
if (!fs.existsSync(temp)){
97-
fs.mkdirSync(temp);
98-
}
9978
fs.writeFileSync(path.join(temp, 'linux_deb_links.zip'),
100-
Buffer.from(linux_deb_dl.data));
79+
Buffer.from(linux_deb_url));
10180
fs.writeFileSync(path.join(temp, 'u_boot_rb1_links.zip'),
102-
Buffer.from(u_boot_rb1_dl.data));
81+
Buffer.from(u_boot_rb1_url));
10382
10483
# make sure we have latest packages first, to get latest fixes and to
10584
# avoid an automated update while we're building

0 commit comments

Comments
 (0)