From 0f4b4452ebe0a6da3c55c81f641345b13186ad4c Mon Sep 17 00:00:00 2001 From: Marcel Klehr Date: Tue, 10 Dec 2024 09:11:27 +0100 Subject: [PATCH] fix(regex): Don't include final slashes --- index.mjs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/index.mjs b/index.mjs index cdb2a90..a7c0c6a 100644 --- a/index.mjs +++ b/index.mjs @@ -4,17 +4,18 @@ import core from '@actions/core' (async () => { // `website` input defined in action metadata file const website = core.getInput('website'); - console.log(`Scraping ${website}!`); + console.log(`Scraping ${website}`); const res = await fetch(website) const html = await res.text() const users = Array.from( new Set( Array.from( - html.matchAll(/]*?href=["']https:\/\/github.com\/([^?]*?)["']/g) + html.matchAll(/]*?href=["']https:\/\/github.com\/([^?\/]*?)\/?["']/g) ) .map(([_, handle]) => handle) ) ) + console.log('Found', users) core.setOutput("users", users.join(',')); })().catch(error => { core.setFailed(error.message);