From 399442f46a29fcd11ad6e75129a466d97eeba0af Mon Sep 17 00:00:00 2001 From: Saravanan Palanisamy Date: Thu, 23 Mar 2023 16:34:09 +0400 Subject: [PATCH] change regex to support non-github.com URLs --- src/add-to-project.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/add-to-project.ts b/src/add-to-project.ts index a3732bc..4f990f3 100644 --- a/src/add-to-project.ts +++ b/src/add-to-project.ts @@ -4,7 +4,7 @@ import * as github from '@actions/github' // TODO: Ensure this (and the Octokit client) works for non-github.com URLs, as well. // https://github.com/orgs|users//projects/ const urlParse = - /^(?:https:\/\/)?github\.com\/(?orgs|users)\/(?[^/]+)\/projects\/(?\d+)/ + /\/(?orgs|users)\/(?[^/]+)\/projects\/(?\d+)/ interface ProjectNodeIDResponse { organization?: { @@ -80,7 +80,7 @@ export async function addToProject(): Promise { if (!urlMatch) { throw new Error( - `Invalid project URL: ${projectUrl}. Project URL should match the format https://github.com///projects/`, + `Invalid project URL: ${projectUrl}. Project URL should match the format ///projects/`, ) }