Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Logging errors at get checksums stage in GH release action #406

Merged
merged 1 commit into from
Aug 15, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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