Fetching the name, version and URL from the package.json file

This commit is contained in:
Peter Murray
2023-12-18 07:16:24 +00:00
committed by GitHub
parent 793303a197
commit 4efffecbc6
3 changed files with 167 additions and 4126 deletions
+162 -4120
View File
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -19,7 +19,7 @@
"bugs": { "bugs": {
"url": "https://github.com/advanced-security/maven-dependency-submission-action/issues" "url": "https://github.com/advanced-security/maven-dependency-submission-action/issues"
}, },
"homepage": "https://github.com/advanced-security/maven-dependency-submission-action#readme", "homepage": "https://github.com/advanced-security/maven-dependency-submission-action",
"dependencies": { "dependencies": {
"@actions/core": "^1.10.1", "@actions/core": "^1.10.1",
"@github/dependency-submission-toolkit": "^1.2.10", "@github/dependency-submission-toolkit": "^1.2.10",
+4 -5
View File
@@ -6,8 +6,7 @@ import { Depgraph, MavenDependencyGraph, parseDependencyJson } from './depgraph'
import { MavenRunner } from './maven-runner'; import { MavenRunner } from './maven-runner';
import { loadFileContents } from './utils/file-utils'; import { loadFileContents } from './utils/file-utils';
const version = require('../package.json')['version']; const packageData = require('../package.json');
const DEPGRAPH_MAVEN_PLUGIN_VERSION = '4.0.2'; const DEPGRAPH_MAVEN_PLUGIN_VERSION = '4.0.2';
export type MavenConfiguration = { export type MavenConfiguration = {
@@ -67,9 +66,9 @@ export async function generateSnapshot(directory: string, mvnConfig?: MavenConfi
function getDetector() { function getDetector() {
return { return {
name: 'maven-dependency-submission-action', name: packageData.name,
url: 'https://github.com/advanced-security/maven-dependency-submission-action', url: packageData.homepage,
version: version version: packageData.version
}; };
} }