Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow projects outside github.com #338

Merged
merged 8 commits into from
Apr 3, 2023
4 changes: 2 additions & 2 deletions src/add-to-project.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import * as github from '@actions/github'
// TODO: Ensure this (and the Octokit client) works for non-gh.neting.cc URLs, as well.
iansan5653 marked this conversation as resolved.
Show resolved Hide resolved
// https://github.com/orgs|users/<ownerName>/projects/<projectNumber>
const urlParse =
/^(?:https:\/\/)?github\.com\/(?<ownerType>orgs|users)\/(?<ownerName>[^/]+)\/projects\/(?<projectNumber>\d+)/
/\/(?<ownerType>orgs|users)\/(?<ownerName>[^/]+)\/projects\/(?<projectNumber>\d+)/
iansan5653 marked this conversation as resolved.
Show resolved Hide resolved

interface ProjectNodeIDResponse {
organization?: {
Expand Down Expand Up @@ -80,7 +80,7 @@ export async function addToProject(): Promise<void> {

if (!urlMatch) {
throw new Error(
`Invalid project URL: ${projectUrl}. Project URL should match the format https://github.com/<orgs-or-users>/<ownerName>/projects/<projectNumber>`,
`Invalid project URL: ${projectUrl}. Project URL should match the format <Github server FQDN>/<orgs-or-users>/<ownerName>/projects/<projectNumber>`,
iansan5653 marked this conversation as resolved.
Show resolved Hide resolved
)
}

Expand Down