register spdx lib as ES Module, start converting call sites to use new spdx pkg - TODO: update tests

This commit is contained in:
Eli Reisman
2024-06-05 12:19:12 -07:00
parent bc5b235cf6
commit ecd706f525
7 changed files with 46 additions and 15 deletions

View File

@@ -1,6 +1,5 @@
import * as core from '@actions/core'
import {Octokit} from 'octokit'
import spdxParse from 'spdx-expression-parse'
import {Changes} from './schemas'
export function groupDependenciesByManifest(
@@ -34,15 +33,6 @@ export function renderUrl(url: string | null, text: string): string {
}
}
export function isSPDXValid(license: string): boolean {
try {
spdxParse(license)
return true
} catch (_) {
return false
}
}
function isEnterprise(): boolean {
const serverUrl = new URL(
process.env['GITHUB_SERVER_URL'] ?? 'https://github.com'