diff --git a/.github/actions/github-release/main.js b/.github/actions/github-release/main.js index d61b24ed5ef3..c0cdc9fbb94a 100644 --- a/.github/actions/github-release/main.js +++ b/.github/actions/github-release/main.js @@ -91,13 +91,25 @@ async function runOnce() { } catch (e) { console.log("ERROR: ", JSON.stringify(e, null, 2)); core.info(`creating a release`); + + const releaseNotes = fs.readFileSync('RELEASES.md').toString(); + let notes = null; + const opts = { + owner, + repo, + tag_name: name, + prerelease: name === 'dev', + }; + if (name !== 'dev') { + for (let x of releaseNotes.split(/^-+$/m)) { + if (x.indexOf(name.substring(1)) == -1) + continue; + opts.body = x; + break; + } + } try { - release = await octokit.rest.repos.createRelease({ - owner, - repo, - tag_name: name, - prerelease: name === 'dev', - }); + release = await octokit.rest.repos.createRelease(opts); } catch(e) { console.log("ERROR: ", JSON.stringify(e, null, 2)); core.info(`fetching one more time`);