Skip to content

Commit

Permalink
update dist for testing
Browse files Browse the repository at this point in the history
  • Loading branch information
afujiwara-roblox committed Mar 29, 2024
1 parent 28524c2 commit e7f5bf6
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 9 deletions.
8 changes: 4 additions & 4 deletions src/foreman.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {addPath} from "@actions/core";
import {exec} from "@actions/exec";
import {GitHub} from "@actions/github";
import { addPath } from "@actions/core";
import { exec } from "@actions/exec";
import { GitHub } from "@actions/github";
import semver from "semver";
import os from "os";

Expand Down Expand Up @@ -113,4 +113,4 @@ export default {
addArtifactoryToken
};

export type {GitHubRelease};
export type { GitHubRelease };
20 changes: 15 additions & 5 deletions src/main.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
import {getInput, debug, addPath, setFailed} from "@actions/core";
import {downloadTool, extractZip} from "@actions/tool-cache";
import {GitHub} from "@actions/github";
import {resolve} from "path";
import {exec} from "@actions/exec";
import { getInput, debug, addPath, setFailed } from "@actions/core";
import { downloadTool, extractZip } from "@actions/tool-cache";
import { GitHub } from "@actions/github";
import { resolve } from "path";
import { exec } from "@actions/exec";

import semver from "semver";
import configFile from "./configFile";
import foreman from "./foreman";

const MIN_ARTIFACTORY_FOREMAN_VERSION = "v1.6.1";

async function run(): Promise<void> {
try {
const versionReq: string = getInput("version");
Expand Down Expand Up @@ -54,6 +58,12 @@ async function run(): Promise<void> {
await foreman.authenticate(githubToken);

if (artifactoryUrl != "" && artifactoryToken != "") { // both defined
if (semver.compare(release.tag_name, MIN_ARTIFACTORY_FOREMAN_VERSION) == -1) {
throw new Error(
"Artifactory support requires Foreman version 1.0.5 or later"
);
}

await foreman.addArtifactoryToken(artifactoryUrl, artifactoryToken);
} else if (artifactoryUrl != "" || artifactoryToken != "") { // only one defined
throw new Error(
Expand Down

0 comments on commit e7f5bf6

Please sign in to comment.