Skip to content

Commit

Permalink
Logging errors at get checksums stage in GH release action
Browse files Browse the repository at this point in the history
Signed-off-by: sethiyash <[email protected]>
  • Loading branch information
sethiyash committed Jul 5, 2023
1 parent 5d98b5e commit a5691f0
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,13 @@ jobs:
const url = require('url');
const https = require('https');
checksums = {}
var releaseMatched = false;
var assetsFound = false;
for (const r of releases["data"]) {
if (r.draft && `refs/tags/${r.tag_name}` == "${{ github.ref }}") {
releaseMatched = true;
for (const asset of r.assets) {
assetsFound = true;
var release_asset = await github.rest.repos.getReleaseAsset({ headers: {accept: `application/octet-stream`}, accept: `application/octet-stream`, owner: owner, repo: repo, asset_id: asset.id });
const hash = crypto.createHash('sha256');
let http_promise = new Promise((resolve, reject) => {
Expand All @@ -100,10 +104,22 @@ jobs:
});
});
await http_promise;
http_promise.then(
(result) => {
console.log(checksums);
},
(error) => {
console.log("Encountered an Error for " + asset.name + " asset: " + error); // Log an error
});
}
}
}
console.log(checksums)
if (!releaseMatched) {
console.log("No release matched")
}
if (!assetsFound) {
console.log("No assets found for " + "${{ github.ref }}" + " release")
}
return `${checksums['release.yml']} ./release.yml
${checksums['package.yml']} ./package.yml
${checksums['package-metadata.yml']} ./package-metadata.yml`
Expand Down

0 comments on commit a5691f0

Please sign in to comment.