From 5bfd654b63f695ef410614256bd6bd822150ced7 Mon Sep 17 00:00:00 2001 From: aler9 <46489434+aler9@users.noreply.github.com> Date: Mon, 13 Nov 2023 11:22:13 +0100 Subject: [PATCH] after a release, post to issues once --- .github/workflows/release.yml | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index fa9af6a25e0..e1cce6d3280 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -81,20 +81,26 @@ jobs: basehead: `${prevTag.commit.sha}...${curTag.commit.sha}`, }); + const issues = {}; + for (const commit of diff.data.commits) { for (const match of commit.commit.message.matchAll(/(^| |\()#([0-9]+)( |\)|$)/g)) { - try { - await github.rest.issues.createComment({ - owner, - repo, - issue_number: parseInt(match[2]), - body: `This issue is mentioned in release ${curTag.name} 🚀\n` - + `Check out the entire changelog by [clicking here](https://github.com/${owner}/${repo}/releases/tag/${curTag.name})`, - }); - } catch (exc) {} + issues[match[2]] = 1; } } + for (const issue in issues) { + try { + await github.rest.issues.createComment({ + owner, + repo, + issue_number: parseInt(issue), + body: `This issue is mentioned in release ${curTag.name} 🚀\n` + + `Check out the entire changelog by [clicking here](https://github.com/${owner}/${repo}/releases/tag/${curTag.name})`, + }); + } catch (exc) {} + } + dockerhub: needs: binaries runs-on: ubuntu-22.04