Skip to content

Commit

Permalink
single quotes
Browse files Browse the repository at this point in the history
  • Loading branch information
hmaurer committed Jul 1, 2024
1 parent 4efd941 commit a47cdc5
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 41 deletions.
12 changes: 6 additions & 6 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ inputs:
maven-args:
description: Additional maven arguments to add to the command line invocation of maven when it generates the dependency snapshot
type: string
default: ""
default: ''

snapshot-include-file-name:
description: Optionally include the file name in the dependency snapshot report to GitHub. This is required to be true if you want the results in the dependency tree to have a working link.
Expand All @@ -44,31 +44,31 @@ inputs:
description: The SHA that the results will be linked to in the dependency snapshot
type: string
required: false
default: ""
default: ''

snapshot-ref:
description: The ref that the results will be linked to in the dependency snapshot
type: string
required: false
default: ""
default: ''

detector-name:
description: The name of the detector that generated the dependency snapshot
type: string
required: false
default: ""
default: ''

detector-version:
description: The version of the detector that generated the dependency snapshot
type: string
required: false
default: ""
default: ''

detector-url:
description: The URL to the detector that generated the dependency snapshot
type: string
required: false
default: ""
default: ''

runs:
using: node20
Expand Down
30 changes: 15 additions & 15 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,32 +1,32 @@
import * as core from "@actions/core";
import * as core from '@actions/core';
import {
Snapshot,
submitSnapshot,
} from "@github/dependency-submission-toolkit";
import { SnapshotConfig, generateSnapshot } from "./snapshot-generator";
} from '@github/dependency-submission-toolkit';
import { SnapshotConfig, generateSnapshot } from './snapshot-generator';

async function run() {
let snapshot: Snapshot | undefined;

try {
const directory = core.getInput("directory", { required: true });
const directory = core.getInput('directory', { required: true });
const mavenConfig = {
ignoreMavenWrapper: core.getBooleanInput("ignore-maven-wrapper"),
settingsFile: core.getInput("settings-file"),
mavenArgs: core.getInput("maven-args") || "",
ignoreMavenWrapper: core.getBooleanInput('ignore-maven-wrapper'),
settingsFile: core.getInput('settings-file'),
mavenArgs: core.getInput('maven-args') || '',
};
const snapshotConfig: SnapshotConfig = {
includeManifestFile: core.getBooleanInput("snapshot-include-file-name"),
manifestFile: core.getInput("snapshot-dependency-file-name"),
sha: core.getInput("snapshot-sha"),
ref: core.getInput("snapshot-ref"),
includeManifestFile: core.getBooleanInput('snapshot-include-file-name'),
manifestFile: core.getInput('snapshot-dependency-file-name'),
sha: core.getInput('snapshot-sha'),
ref: core.getInput('snapshot-ref'),
};
const detectorName = core.getInput("detector-name");
if (detectorName == "") {
const detectorName = core.getInput('detector-name');
if (detectorName == '') {
snapshotConfig.detector = {
name: detectorName,
url: core.getInput("detector-url"),
version: core.getInput("detector-version"),
url: core.getInput('detector-url'),
version: core.getInput('detector-version'),
};
}

Expand Down
40 changes: 20 additions & 20 deletions src/snapshot-generator.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
import * as core from "@actions/core";
import * as path from "path";
import * as core from '@actions/core';
import * as path from 'path';

import { Manifest, Snapshot } from "@github/dependency-submission-toolkit";
import { Manifest, Snapshot } from '@github/dependency-submission-toolkit';
import {
Depgraph,
MavenDependencyGraph,
parseDependencyJson,
} from "./depgraph";
import { MavenRunner } from "./maven-runner";
import { loadFileContents } from "./utils/file-utils";
} from './depgraph';
import { MavenRunner } from './maven-runner';
import { loadFileContents } from './utils/file-utils';

const packageData = require("../package.json");
const DEPGRAPH_MAVEN_PLUGIN_VERSION = "4.0.2";
const packageData = require('../package.json');
const DEPGRAPH_MAVEN_PLUGIN_VERSION = '4.0.2';

export type MavenConfiguration = {
ignoreMavenWrapper?: boolean;
Expand Down Expand Up @@ -50,7 +50,7 @@ export async function generateSnapshot(
pomFile = snapshotConfig.manifestFile;
} else {
// The filepath to the POM needs to be relative to the root of the GitHub repository for the links to work once uploaded
pomFile = getRepositoryRelativePath(path.join(directory, "pom.xml"));
pomFile = getRepositoryRelativePath(path.join(directory, 'pom.xml'));
}
manifest = mavenDependencies.createManifest(pomFile);
} else {
Expand Down Expand Up @@ -103,11 +103,11 @@ export async function generateDependencyGraph(
config?.mavenArgs,
);

core.startGroup("depgraph-maven-plugin:reactor");
core.startGroup('depgraph-maven-plugin:reactor');
const mavenReactorArguments = [
`com.github.ferstl:depgraph-maven-plugin:${DEPGRAPH_MAVEN_PLUGIN_VERSION}:reactor`,
"-DgraphFormat=json",
"-DoutputFileName=reactor.json",
'-DgraphFormat=json',
'-DoutputFileName=reactor.json',
];
const reactorResults = await mvn.exec(directory, mavenReactorArguments);

Expand All @@ -121,12 +121,12 @@ export async function generateDependencyGraph(
);
}

core.startGroup("depgraph-maven-plugin:aggregate");
core.startGroup('depgraph-maven-plugin:aggregate');
const mavenAggregateArguments = [
`com.github.ferstl:depgraph-maven-plugin:${DEPGRAPH_MAVEN_PLUGIN_VERSION}:aggregate`,
"-DgraphFormat=json",
"-DoutputDirectory=target",
"-DoutputFileName=aggregate-depgraph.json",
'-DgraphFormat=json',
'-DoutputDirectory=target',
'-DoutputFileName=aggregate-depgraph.json',
];
const aggregateResults = await mvn.exec(directory, mavenAggregateArguments);

Expand All @@ -146,13 +146,13 @@ export async function generateDependencyGraph(
);
}

const targetPath = path.join(directory, "target");
const targetPath = path.join(directory, 'target');
const isMultiModule = checkForMultiModule(
path.join(targetPath, "reactor.json"),
path.join(targetPath, 'reactor.json'),
);

// Now we have the aggregate dependency graph file to process
const aggregateGraphFile = path.join(targetPath, "aggregate-depgraph.json");
const aggregateGraphFile = path.join(targetPath, 'aggregate-depgraph.json');
try {
return parseDependencyJson(aggregateGraphFile, isMultiModule);
} catch (err: any) {
Expand Down Expand Up @@ -182,7 +182,7 @@ function checkForMultiModule(reactorJsonFile): boolean {

// TODO this is assuming the checkout was made into the base path of the workspace...
function getRepositoryRelativePath(file) {
const workspaceDirectory = path.resolve(process.env.GITHUB_WORKSPACE || ".");
const workspaceDirectory = path.resolve(process.env.GITHUB_WORKSPACE || '.');
const fileResolved = path.resolve(file);
const fileDirectory = path.dirname(fileResolved);

Expand Down

0 comments on commit a47cdc5

Please sign in to comment.