Skip to content

Commit

Permalink
fix(regex): Don't include final slashes
Browse files Browse the repository at this point in the history
  • Loading branch information
marcelklehr authored Dec 10, 2024
1 parent a739600 commit 0f4b445
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions index.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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(/<a [^>]*?href=["']https:\/\/github.com\/([^?]*?)["']/g)
html.matchAll(/<a [^>]*?href=["']https:\/\/github.com\/([^?\/]*?)\/?["']/g)
)
.map(([_, handle]) => handle)
)
)
console.log('Found', users)
core.setOutput("users", users.join(','));
})().catch(error => {
core.setFailed(error.message);
Expand Down

0 comments on commit 0f4b445

Please sign in to comment.