From aa1e86aa1bdc7be013475cacd82177824024f6c1 Mon Sep 17 00:00:00 2001 From: Luc Perkins Date: Tue, 23 Apr 2024 12:28:00 -0300 Subject: [PATCH] Fix issue with extra-labels and extra-tags --- dist/index.js | 7 ++++++- dist/index.js.map | 2 +- ts/index.ts | 17 +++++++++++------ 3 files changed, 18 insertions(+), 8 deletions(-) diff --git a/dist/index.js b/dist/index.js index 9463e93..3c915ad 100644 --- a/dist/index.js +++ b/dist/index.js @@ -94286,7 +94286,6 @@ var FlakeHubPushAction = class { this.repository = inputs_exports.getString("repository"); this.directory = inputs_exports.getString("directory"); this.gitRoot = inputs_exports.getString("git-root"); - this.extraLabels = inputs_exports.getString("extra-labels") === "" ? inputs_exports.getString("extra-tags") : ""; this.spdxExpression = inputs_exports.getString("spdx-expression"); this.errorOnConflict = inputs_exports.getBool("error-on-conflict"); this.includeOutputPaths = inputs_exports.getBool("include-output-paths"); @@ -94295,6 +94294,12 @@ var FlakeHubPushAction = class { this.name = inputs_exports.getStringOrNull("name"); this.rollingMinor = inputs_exports.getNumberOrNull("rolling-minor"); } + // extra-tags is deprecated but we still honor it + get extraLabels() { + const labels = inputs_exports.getString("extra-labels"); + const tags = inputs_exports.getString("extra-tags"); + return labels !== "" ? labels : tags; + } // We first check for a value using the `source-binary` input and fall back to the // now-deprecated `flakehub-push-binary` get sourceBinary() { diff --git a/dist/index.js.map b/dist/index.js.map index 9bb65ce..f740fa8 100644 --- a/dist/index.js.map +++ b/dist/index.js.map @@ -1 +1 @@ -{"version":3,"sources":["../ts/index.ts"],"sourcesContent":["import * as actionsCore from \"@actions/core\";\nimport * as actionsExec from \"@actions/exec\";\nimport { ActionOptions, IdsToolbox, inputs } from \"detsys-ts\";\n\nconst EVENT_EXECUTION_FAILURE = \"execution_failure\";\n\nconst VISIBILITY_OPTIONS = [\"public\", \"unlisted\", \"private\"];\n\ntype Visibility = \"public\" | \"unlisted\" | \"private\";\n\ntype ExecutionEnvironment = {\n FLAKEHUB_PUSH_VISIBILITY?: string;\n FLAKEHUB_PUSH_TAG?: string;\n FLAKEHUB_PUSH_HOST?: string;\n FLAKEHUB_PUSH_LOG_DIRECTIVES?: string;\n FLAKEHUB_PUSH_LOGGER?: string;\n FLAKEHUB_PUSH_GITHUB_TOKEN?: string;\n FLAKEHUB_PUSH_NAME?: string;\n FLAKEHUB_PUSH_REPOSITORY?: string;\n FLAKEHUB_PUSH_DIRECTORY?: string;\n FLAKEHUB_PUSH_GIT_ROOT?: string;\n FLAKEHUB_PUSH_EXTRA_LABELS?: string;\n FLAKEHUB_PUSH_SPDX_EXPRESSION?: string;\n FLAKEHUB_PUSH_ERROR_ON_CONFLICT?: string;\n FLAKEHUB_PUSH_INCLUDE_OUTPUT_PATHS?: string;\n FLAKEHUB_PUSH_ROLLING?: string;\n FLAKEHUB_PUSH_MIRROR?: string;\n FLAKEHUB_PUSH_ROLLING_MINOR?: string;\n};\n\nclass FlakeHubPushAction {\n idslib: IdsToolbox;\n\n // Action inputs translated into environment variables to pass to flakehub-push\n private tag: string;\n private host: string;\n private logDirectives: string;\n private logger: string;\n private gitHubToken: string;\n private repository: string;\n private directory: string;\n private gitRoot: string;\n private extraLabels: string;\n private spdxExpression: string;\n private errorOnConflict: boolean;\n private includeOutputPaths: boolean;\n private rolling: boolean;\n private mirror: boolean;\n private name: string | null;\n private rollingMinor: number | null;\n\n constructor() {\n const options: ActionOptions = {\n name: \"flakehub-push\",\n fetchStyle: \"gh-env-style\",\n diagnosticsUrl: new URL(\n \"https://install.determinate.systems/flakehub-push/telemetry\",\n ),\n legacySourcePrefix: \"flakehub-push\",\n requireNix: \"fail\",\n };\n\n this.idslib = new IdsToolbox(options);\n\n // Inputs translated into environment variables for flakehub-push\n this.tag = inputs.getString(\"tag\");\n this.host = inputs.getString(\"host\");\n this.logDirectives = inputs.getString(\"log-directives\");\n this.logger = inputs.getString(\"logger\");\n this.gitHubToken = inputs.getString(\"github-token\");\n this.repository = inputs.getString(\"repository\");\n this.directory = inputs.getString(\"directory\");\n this.gitRoot = inputs.getString(\"git-root\");\n // extra-tags is deprecated but we still honor it\n this.extraLabels =\n inputs.getString(\"extra-labels\") === \"\"\n ? inputs.getString(\"extra-tags\")\n : \"\";\n this.spdxExpression = inputs.getString(\"spdx-expression\");\n this.errorOnConflict = inputs.getBool(\"error-on-conflict\");\n this.includeOutputPaths = inputs.getBool(\"include-output-paths\");\n this.rolling = inputs.getBool(\"rolling\");\n this.mirror = inputs.getBool(\"mirror\");\n this.name = inputs.getStringOrNull(\"name\");\n this.rollingMinor = inputs.getNumberOrNull(\"rolling-minor\");\n }\n\n // We first check for a value using the `source-binary` input and fall back to the\n // now-deprecated `flakehub-push-binary`\n private get sourceBinary(): string | null {\n const sourceBinaryInput = inputs.getStringOrNull(\"source-binary\");\n const flakeHubPushBinaryInput = inputs.getStringOrNull(\n \"flakehub-push-binary\",\n );\n\n return sourceBinaryInput !== \"\"\n ? sourceBinaryInput\n : flakeHubPushBinaryInput;\n }\n\n private get visibility(): Visibility {\n const visibility = inputs.getString(\"visibility\");\n if (!VISIBILITY_OPTIONS.includes(visibility)) {\n actionsCore.setFailed(\n `Visibility option \\`${visibility}\\` not recognized. Available options: ${VISIBILITY_OPTIONS.map((opt) => `\\`${opt}\\``).join(\", \")}.`,\n );\n }\n return visibility as Visibility;\n }\n\n private async executionEnvironment(): Promise {\n const env: ExecutionEnvironment = {};\n\n env.FLAKEHUB_PUSH_VISIBILITY = this.visibility;\n env.FLAKEHUB_PUSH_TAG = this.tag;\n env.FLAKEHUB_PUSH_HOST = this.host;\n env.FLAKEHUB_PUSH_LOG_DIRECTIVES = this.logDirectives;\n env.FLAKEHUB_PUSH_LOGGER = this.logger;\n env.FLAKEHUB_PUSH_GITHUB_TOKEN = this.gitHubToken;\n env.FLAKEHUB_PUSH_REPOSITORY = this.repository;\n env.FLAKEHUB_PUSH_DIRECTORY = this.directory;\n env.FLAKEHUB_PUSH_GIT_ROOT = this.gitRoot;\n // not included: the now-deprecated FLAKEHUB_PUSH_EXTRA_TAGS\n env.FLAKEHUB_PUSH_EXTRA_LABELS = this.extraLabels;\n env.FLAKEHUB_PUSH_SPDX_EXPRESSION = this.spdxExpression;\n env.FLAKEHUB_PUSH_ERROR_ON_CONFLICT = this.errorOnConflict.toString();\n env.FLAKEHUB_PUSH_INCLUDE_OUTPUT_PATHS = this.includeOutputPaths.toString();\n env.FLAKEHUB_PUSH_ROLLING = this.rolling.toString();\n env.FLAKEHUB_PUSH_MIRROR = this.mirror.toString();\n\n if (this.name !== null) {\n env.FLAKEHUB_PUSH_NAME = this.name;\n }\n\n if (this.rollingMinor !== null) {\n env.FLAKEHUB_PUSH_ROLLING_MINOR = this.rollingMinor.toString();\n }\n\n return env;\n }\n\n async push(): Promise {\n const executionEnv = await this.executionEnvironment();\n\n const binary =\n this.sourceBinary !== null\n ? this.sourceBinary\n : await this.idslib.fetchExecutable();\n\n actionsCore.debug(\n `execution environment: ${JSON.stringify(executionEnv, null, 2)}`,\n );\n\n const exitCode = await actionsExec.exec(\n binary,\n // We're setting this via flag for now due to a misspelling in the original environment variable.\n // Remove this in favor of the environment variable only after PR #125 is merged.\n [\"--visibility\", this.visibility],\n {\n env: {\n ...executionEnv,\n ...process.env, // To get PATH, etc.\n },\n },\n );\n\n if (exitCode !== 0) {\n this.idslib.recordEvent(EVENT_EXECUTION_FAILURE, {\n exitCode,\n });\n actionsCore.setFailed(`non-zero exit code of ${exitCode} detected`);\n } else {\n actionsCore.info(`Flake release was successfully published`);\n }\n }\n}\n\nfunction main(): void {\n const flakeHubPush = new FlakeHubPushAction();\n\n flakeHubPush.idslib.onMain(async () => {\n await flakeHubPush.push();\n });\n\n flakeHubPush.idslib.execute();\n}\n\nmain();\n"],"mappings":";AAAA,YAAY,iBAAiB;AAC7B,YAAY,iBAAiB;AAC7B,SAAwB,YAAY,cAAc;AAElD,IAAM,0BAA0B;AAEhC,IAAM,qBAAqB,CAAC,UAAU,YAAY,SAAS;AAwB3D,IAAM,qBAAN,MAAyB;AAAA,E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AA,QAC/C;AAAA,MACF,CAAC;AACD,MAAY,sBAAU,yBAAyB,QAAQ,WAAW;AAAA,IACpE,OAAO;AACL,MAAY,iBAAK,0CAA0C;AAAA,IAC7D;AAAA,EACF;AACF;AAEA,SAAS,OAAa;AACpB,QAAM,eAAe,IAAI,mBAAmB;AAE5C,eAAa,OAAO,OAAO,YAAY;AACrC,UAAM,aAAa,KAAK;AAAA,EAC1B,CAAC;AAED,eAAa,OAAO,QAAQ;AAC9B;AAEA,KAAK;","names":[]} \ No newline at end of file +{"version":3,"sources":["../ts/index.ts"],"sourcesContent":["import * as actionsCore from \"@actions/core\";\nimport * as actionsExec from \"@actions/exec\";\nimport { ActionOptions, IdsToolbox, inputs } from \"detsys-ts\";\n\nconst EVENT_EXECUTION_FAILURE = \"execution_failure\";\n\nconst VISIBILITY_OPTIONS = [\"public\", \"unlisted\", \"private\"];\n\ntype Visibility = \"public\" | \"unlisted\" | \"private\";\n\ntype ExecutionEnvironment = {\n FLAKEHUB_PUSH_VISIBILITY?: string;\n FLAKEHUB_PUSH_TAG?: string;\n FLAKEHUB_PUSH_HOST?: string;\n FLAKEHUB_PUSH_LOG_DIRECTIVES?: string;\n FLAKEHUB_PUSH_LOGGER?: string;\n FLAKEHUB_PUSH_GITHUB_TOKEN?: string;\n FLAKEHUB_PUSH_NAME?: string;\n FLAKEHUB_PUSH_REPOSITORY?: string;\n FLAKEHUB_PUSH_DIRECTORY?: string;\n FLAKEHUB_PUSH_GIT_ROOT?: string;\n FLAKEHUB_PUSH_EXTRA_LABELS?: string;\n FLAKEHUB_PUSH_SPDX_EXPRESSION?: string;\n FLAKEHUB_PUSH_ERROR_ON_CONFLICT?: string;\n FLAKEHUB_PUSH_INCLUDE_OUTPUT_PATHS?: string;\n FLAKEHUB_PUSH_ROLLING?: string;\n FLAKEHUB_PUSH_MIRROR?: string;\n FLAKEHUB_PUSH_ROLLING_MINOR?: string;\n};\n\nclass FlakeHubPushAction {\n idslib: IdsToolbox;\n\n // Action inputs translated into environment variables to pass to flakehub-push\n private tag: string;\n private host: string;\n private logDirectives: string;\n private logger: string;\n private gitHubToken: string;\n private repository: string;\n private directory: string;\n private gitRoot: string;\n private spdxExpression: string;\n private errorOnConflict: boolean;\n private includeOutputPaths: boolean;\n private rolling: boolean;\n private mirror: boolean;\n private name: string | null;\n private rollingMinor: number | null;\n\n constructor() {\n const options: ActionOptions = {\n name: \"flakehub-push\",\n fetchStyle: \"gh-env-style\",\n diagnosticsUrl: new URL(\n \"https://install.determinate.systems/flakehub-push/telemetry\",\n ),\n legacySourcePrefix: \"flakehub-push\",\n requireNix: \"fail\",\n };\n\n this.idslib = new IdsToolbox(options);\n\n // Inputs translated into environment variables for flakehub-push\n this.tag = inputs.getString(\"tag\");\n this.host = inputs.getString(\"host\");\n this.logDirectives = inputs.getString(\"log-directives\");\n this.logger = inputs.getString(\"logger\");\n this.gitHubToken = inputs.getString(\"github-token\");\n this.repository = inputs.getString(\"repository\");\n this.directory = inputs.getString(\"directory\");\n this.gitRoot = inputs.getString(\"git-root\");\n this.spdxExpression = inputs.getString(\"spdx-expression\");\n this.errorOnConflict = inputs.getBool(\"error-on-conflict\");\n this.includeOutputPaths = inputs.getBool(\"include-output-paths\");\n this.rolling = inputs.getBool(\"rolling\");\n this.mirror = inputs.getBool(\"mirror\");\n this.name = inputs.getStringOrNull(\"name\");\n this.rollingMinor = inputs.getNumberOrNull(\"rolling-minor\");\n }\n\n // extra-tags is deprecated but we still honor it\n private get extraLabels(): string {\n const labels = inputs.getString(\"extra-labels\"); // current input name\n const tags = inputs.getString(\"extra-tags\"); // deprecated input name\n\n // If `extra-labels` is set to something use it, otherwise use `extra-tags`.\n // It `extra-tags` is also not set, which means that it's an empty string, that's\n // still valid, as the flakehub-push CLI expects a comma-separated list here.\n return labels !== \"\" ? labels : tags;\n }\n\n // We first check for a value using the `source-binary` input and fall back to the\n // now-deprecated `flakehub-push-binary`\n private get sourceBinary(): string | null {\n const sourceBinaryInput = inputs.getStringOrNull(\"source-binary\");\n const flakeHubPushBinaryInput = inputs.getStringOrNull(\n \"flakehub-push-binary\",\n );\n\n return sourceBinaryInput !== \"\"\n ? sourceBinaryInput\n : flakeHubPushBinaryInput;\n }\n\n private get visibility(): Visibility {\n const visibility = inputs.getString(\"visibility\");\n if (!VISIBILITY_OPTIONS.includes(visibility)) {\n actionsCore.setFailed(\n `Visibility option \\`${visibility}\\` not recognized. Available options: ${VISIBILITY_OPTIONS.map((opt) => `\\`${opt}\\``).join(\", \")}.`,\n );\n }\n return visibility as Visibility;\n }\n\n private async executionEnvironment(): Promise {\n const env: ExecutionEnvironment = {};\n\n env.FLAKEHUB_PUSH_VISIBILITY = this.visibility;\n env.FLAKEHUB_PUSH_TAG = this.tag;\n env.FLAKEHUB_PUSH_HOST = this.host;\n env.FLAKEHUB_PUSH_LOG_DIRECTIVES = this.logDirectives;\n env.FLAKEHUB_PUSH_LOGGER = this.logger;\n env.FLAKEHUB_PUSH_GITHUB_TOKEN = this.gitHubToken;\n env.FLAKEHUB_PUSH_REPOSITORY = this.repository;\n env.FLAKEHUB_PUSH_DIRECTORY = this.directory;\n env.FLAKEHUB_PUSH_GIT_ROOT = this.gitRoot;\n // not included: the now-deprecated FLAKEHUB_PUSH_EXTRA_TAGS\n env.FLAKEHUB_PUSH_EXTRA_LABELS = this.extraLabels;\n env.FLAKEHUB_PUSH_SPDX_EXPRESSION = this.spdxExpression;\n env.FLAKEHUB_PUSH_ERROR_ON_CONFLICT = this.errorOnConflict.toString();\n env.FLAKEHUB_PUSH_INCLUDE_OUTPUT_PATHS = this.includeOutputPaths.toString();\n env.FLAKEHUB_PUSH_ROLLING = this.rolling.toString();\n env.FLAKEHUB_PUSH_MIRROR = this.mirror.toString();\n\n if (this.name !== null) {\n env.FLAKEHUB_PUSH_NAME = this.name;\n }\n\n if (this.rollingMinor !== null) {\n env.FLAKEHUB_PUSH_ROLLING_MINOR = this.rollingMinor.toString();\n }\n\n return env;\n }\n\n async push(): Promise {\n const executionEnv = await this.executionEnvironment();\n\n const binary =\n this.sourceBinary !== null\n ? this.sourceBinary\n : await this.idslib.fetchExecutable();\n\n actionsCore.debug(\n `execution environment: ${JSON.stringify(executionEnv, null, 2)}`,\n );\n\n const exitCode = await actionsExec.exec(\n binary,\n // We're setting this via flag for now due to a misspelling in the original environment variable.\n // Remove this in favor of the environment variable only after PR #125 is merged.\n [\"--visibility\", this.visibility],\n {\n env: {\n ...executionEnv,\n ...process.env, // To get PATH, etc.\n },\n },\n );\n\n if (exitCode !== 0) {\n this.idslib.recordEvent(EVENT_EXECUTION_FAILURE, {\n exitCode,\n });\n actionsCore.setFailed(`non-zero exit code of ${exitCode} detected`);\n } else {\n actionsCore.info(`Flake release was successfully published`);\n }\n }\n}\n\nfunction main(): void {\n const flakeHubPush = new FlakeHubPushAction();\n\n flakeHubPush.idslib.onMain(async () => {\n await flakeHubPush.push();\n });\n\n flakeHubPush.idslib.execute();\n}\n\nmain();\n"],"mappings":";AAAA,YAAY,iBAAiB;AAC7B,YAAY,iBAAiB;AAC7B,SAAwB,YAAY,cAAc;AAElD,IAAM,0BAA0B;AAEhC,IAAM,qBAAqB,CAAC,UAAU,YAAY,SAAS;AAwB3D,IAAM,qBAAN,MAAyB;AAAA,EAoBvB,cAAc;AACZ,UAAM,UAAyB;AAAA,MAC7B,MAAM;AAAA,MACN,YAAY;AAAA,MACZ,gBAAgB,IAAI;AAAA,QAClB;AAAA,MACF;AAAA,MACA,oBAAoB;AAAA,MACpB,YAAY;AAAA,IACd;AAEA,SAAK,SAAS,IAAI,WAAW,OAAO;AAGpC,SAAK,MAAM,OAAO,UAAU,KAAK;AACjC,SAAK,OAAO,OAAO,UAAU,MAAM;AACnC,SAAK,gBAAgB,OAAO,UAAU,gBAAgB;AACtD,SAAK,SAAS,OAAO,UAAU,QAAQ;AACvC,SAAK,cAAc,OAAO,UAAU,cAAc;AAClD,SAAK,aAAa,OAAO,UAAU,YAAY;AAC/C,SAAK,YAAY,OAAO,UAAU,WAAW;AAC7C,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ts/index.ts @@ -40,7 +40,6 @@ class FlakeHubPushAction { private repository: string; private directory: string; private gitRoot: string; - private extraLabels: string; private spdxExpression: string; private errorOnConflict: boolean; private includeOutputPaths: boolean; @@ -71,11 +70,6 @@ class FlakeHubPushAction { this.repository = inputs.getString("repository"); this.directory = inputs.getString("directory"); this.gitRoot = inputs.getString("git-root"); - // extra-tags is deprecated but we still honor it - this.extraLabels = - inputs.getString("extra-labels") === "" - ? inputs.getString("extra-tags") - : ""; this.spdxExpression = inputs.getString("spdx-expression"); this.errorOnConflict = inputs.getBool("error-on-conflict"); this.includeOutputPaths = inputs.getBool("include-output-paths"); @@ -85,6 +79,17 @@ class FlakeHubPushAction { this.rollingMinor = inputs.getNumberOrNull("rolling-minor"); } + // extra-tags is deprecated but we still honor it + private get extraLabels(): string { + const labels = inputs.getString("extra-labels"); // current input name + const tags = inputs.getString("extra-tags"); // deprecated input name + + // If `extra-labels` is set to something use it, otherwise use `extra-tags`. + // It `extra-tags` is also not set, which means that it's an empty string, that's + // still valid, as the flakehub-push CLI expects a comma-separated list here. + return labels !== "" ? labels : tags; + } + // We first check for a value using the `source-binary` input and fall back to the // now-deprecated `flakehub-push-binary` private get sourceBinary(): string | null {