From 48e96f8eac371d2155bfcc663f13c30ff528bed8 Mon Sep 17 00:00:00 2001 From: Luc Perkins Date: Mon, 22 Apr 2024 12:19:38 -0300 Subject: [PATCH] Require org name match only when not mirroring --- dist/index.js | 2 +- dist/index.js.map | 2 +- ts/index.ts | 3 ++- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/dist/index.js b/dist/index.js index 541a48c..db9dd14 100644 --- a/dist/index.js +++ b/dist/index.js @@ -94352,7 +94352,7 @@ var FlakeHubPushAction = class { } const orgName = parts.at(0); const repoName = parts.at(1); - if (orgName !== org) { + if (orgName !== org && !this.mirror) { throw new Error( `The org name \`${orgName}\` that you specified using the \`name\` input doesn't match the actual org name \`${org}\`` ); diff --git a/dist/index.js.map b/dist/index.js.map index 4ba0b75..09136a2 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_VISIBLITY?: string;\n FLAKEHUB_PUSH_TAG?: string;\n FLAKEHUB_PUSH_ROLLING_MINOR?: string;\n FLAKEHUB_PUSH_ROLLING?: 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_MIRROR?: 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_EXTRA_TAGS?: string;\n FLAKEHUB_PUSH_SPDX_EXPRESSION?: string;\n FLAKEHUB_PUSH_ERROR_ON_CONFLICT?: string;\n FLAKEHUB_PUSH_INCLUDE_OUTPUT_PATHS?: string;\n};\n\nclass FlakeHubPushAction {\n idslib: IdsToolbox;\n\n // Action inputs\n private visibility: Visibility;\n private name: string | null;\n private repository: string;\n private mirror: boolean;\n private directory: string;\n private gitRoot: string;\n private tag: string;\n private rollingMinor: number | null;\n private rolling: boolean;\n private host: string;\n private logDirectives: string;\n private logger: string;\n private gitHubToken: string;\n private extraLabels: string;\n private spdxExpression: string;\n private errorOnConflict: boolean;\n private includeOutputPaths: boolean;\n private flakeHubPushBinary: string | null;\n\n constructor() {\n const options: ActionOptions = {\n name: \"flakehub-push\",\n fetchStyle: \"nix-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\n const visibility = this.verifyVisibility();\n this.visibility = visibility;\n\n this.name = inputs.getStringOrNull(\"name\");\n this.repository = inputs.getString(\"repository\");\n this.mirror = inputs.getBool(\"mirror\");\n this.directory = inputs.getString(\"directory\");\n this.gitRoot = inputs.getString(\"git-root\");\n this.tag = inputs.getString(\"tag\");\n this.rollingMinor = inputs.getNumberOrNull(\"rolling-minor\");\n this.rolling = inputs.getBool(\"rolling\");\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 // 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.flakeHubPushBinary = inputs.getStringOrNull(\"flakehub-push-binary\");\n }\n\n private verifyVisibility(): Visibility {\n const visibility = inputs.getString(\"visibility\");\n if (!VISIBILITY_OPTIONS.includes(visibility)) {\n throw new Error(\n `Visibility option \\`${visibility}\\` not recognized. Available options: ${VISIBILITY_OPTIONS.join(\", \")}.`,\n );\n }\n return visibility as Visibility;\n }\n\n private async executionEnvironment(): Promise {\n const env: ExecutionEnvironment = {};\n\n env.FLAKEHUB_PUSH_VISIBLITY = 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_NAME = this.flakeName;\n env.FLAKEHUB_PUSH_REPOSITORY = this.repository;\n env.FLAKEHUB_PUSH_DIRECTORY = this.directory;\n env.FLAKEHUB_PUSH_GIT_ROOT = this.gitRoot;\n env.FLAKEHUB_PUSH_EXTRA_LABELS = this.extraLabels;\n env.FLAKEHUB_PUSH_SPDX_EXPRESSION = this.spdxExpression;\n\n if (!this.rolling) {\n env.FLAKEHUB_PUSH_ROLLING = \"false\";\n }\n\n if (!this.mirror) {\n env.FLAKEHUB_PUSH_MIRROR = \"false\";\n }\n\n if (!this.errorOnConflict) {\n env.FLAKEHUB_PUSH_ERROR_ON_CONFLICT = \"false\";\n }\n\n if (!this.includeOutputPaths) {\n env.FLAKEHUB_PUSH_INCLUDE_OUTPUT_PATHS = \"false\";\n }\n\n if (this.rollingMinor !== null) {\n env.FLAKEHUB_PUSH_ROLLING_MINOR = this.rollingMinor.toString();\n }\n\n return env;\n }\n\n private get flakeName(): string {\n let name: string;\n\n const org = process.env[\"GITHUB_REPOSITORY_OWNER\"];\n const repo = process.env[\"GITHUB_REPOSITORY\"];\n\n if (this.name !== null) {\n if (this.name === \"\") {\n throw new Error(\"The `name` field can't be an empty string\");\n }\n\n const parts = this.name.split(\"/\");\n\n if (parts.length === 1 || parts.length > 2) {\n throw new Error(\"The specified `name` must of the form {org}/{repo}\");\n }\n\n const orgName = parts.at(0);\n const repoName = parts.at(1);\n\n if (orgName !== org) {\n throw new Error(\n `The org name \\`${orgName}\\` that you specified using the \\`name\\` input doesn't match the actual org name \\`${org}\\``,\n );\n }\n\n name = `${orgName}/${repoName}`;\n } else {\n name = `${org}/${repo}`;\n }\n\n return name;\n }\n\n async push(): Promise {\n const executionEnv = await this.executionEnvironment();\n\n const binary =\n this.flakeHubPushBinary !== null\n ? this.flakeHubPushBinary\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(binary, [], {\n env: {\n ...executionEnv,\n ...process.env, // To get PATH, etc.\n },\n });\n\n if (exitCode !== 0) {\n this.idslib.recordEvent(EVENT_EXECUTION_FAILURE, {\n exitCode,\n });\n throw new Error(`non-zero exit code of ${exitCode} detected`);\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;AAyB3D,IAAM,qBAAN,MAAyB;AAAA,EAuBvB,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,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AM,SACJ,KAAK,uBAAuB,OACxB,KAAK,qBACL,MAAM,KAAK,OAAO,gBAAgB;AAExC,IAAY;AAAA,MACV,0BAA0B,KAAK,UAAU,cAAc,MAAM,CAAC,CAAC;AAAA,IACjE;AAEA,UAAM,WAAW,MAAkB,iBAAK,QAAQ,CAAC,GAAG;AAAA,MAClD,KAAK;AAAA,QACH,GAAG;AAAA,QACH,GAAG,QAAQ;AAAA;AAAA,MACb;AAAA,IACF,CAAC;AAED,QAAI,aAAa,GAAG;AAClB,WAAK,OAAO,YAAY,yBAAyB;AAAA,QAC/C;AAAA,MACF,CAAC;AACD,YAAM,IAAI,MAAM,yBAAyB,QAAQ,WAAW;AAAA,IAC9D;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_VISIBLITY?: string;\n FLAKEHUB_PUSH_TAG?: string;\n FLAKEHUB_PUSH_ROLLING_MINOR?: string;\n FLAKEHUB_PUSH_ROLLING?: 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_MIRROR?: 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_EXTRA_TAGS?: string;\n FLAKEHUB_PUSH_SPDX_EXPRESSION?: string;\n FLAKEHUB_PUSH_ERROR_ON_CONFLICT?: string;\n FLAKEHUB_PUSH_INCLUDE_OUTPUT_PATHS?: string;\n};\n\nclass FlakeHubPushAction {\n idslib: IdsToolbox;\n\n // Action inputs\n private visibility: Visibility;\n private name: string | null;\n private repository: string;\n private mirror: boolean;\n private directory: string;\n private gitRoot: string;\n private tag: string;\n private rollingMinor: number | null;\n private rolling: boolean;\n private host: string;\n private logDirectives: string;\n private logger: string;\n private gitHubToken: string;\n private extraLabels: string;\n private spdxExpression: string;\n private errorOnConflict: boolean;\n private includeOutputPaths: boolean;\n private flakeHubPushBinary: string | null;\n\n constructor() {\n const options: ActionOptions = {\n name: \"flakehub-push\",\n fetchStyle: \"nix-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\n const visibility = this.verifyVisibility();\n this.visibility = visibility;\n\n this.name = inputs.getStringOrNull(\"name\");\n this.repository = inputs.getString(\"repository\");\n this.mirror = inputs.getBool(\"mirror\");\n this.directory = inputs.getString(\"directory\");\n this.gitRoot = inputs.getString(\"git-root\");\n this.tag = inputs.getString(\"tag\");\n this.rollingMinor = inputs.getNumberOrNull(\"rolling-minor\");\n this.rolling = inputs.getBool(\"rolling\");\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 // 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.flakeHubPushBinary = inputs.getStringOrNull(\"flakehub-push-binary\");\n }\n\n private verifyVisibility(): Visibility {\n const visibility = inputs.getString(\"visibility\");\n if (!VISIBILITY_OPTIONS.includes(visibility)) {\n throw new Error(\n `Visibility option \\`${visibility}\\` not recognized. Available options: ${VISIBILITY_OPTIONS.join(\", \")}.`,\n );\n }\n return visibility as Visibility;\n }\n\n private async executionEnvironment(): Promise {\n const env: ExecutionEnvironment = {};\n\n env.FLAKEHUB_PUSH_VISIBLITY = 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_NAME = this.flakeName;\n env.FLAKEHUB_PUSH_REPOSITORY = this.repository;\n env.FLAKEHUB_PUSH_DIRECTORY = this.directory;\n env.FLAKEHUB_PUSH_GIT_ROOT = this.gitRoot;\n env.FLAKEHUB_PUSH_EXTRA_LABELS = this.extraLabels;\n env.FLAKEHUB_PUSH_SPDX_EXPRESSION = this.spdxExpression;\n\n if (!this.rolling) {\n env.FLAKEHUB_PUSH_ROLLING = \"false\";\n }\n\n if (!this.mirror) {\n env.FLAKEHUB_PUSH_MIRROR = \"false\";\n }\n\n if (!this.errorOnConflict) {\n env.FLAKEHUB_PUSH_ERROR_ON_CONFLICT = \"false\";\n }\n\n if (!this.includeOutputPaths) {\n env.FLAKEHUB_PUSH_INCLUDE_OUTPUT_PATHS = \"false\";\n }\n\n if (this.rollingMinor !== null) {\n env.FLAKEHUB_PUSH_ROLLING_MINOR = this.rollingMinor.toString();\n }\n\n return env;\n }\n\n private get flakeName(): string {\n let name: string;\n\n const org = process.env[\"GITHUB_REPOSITORY_OWNER\"];\n const repo = process.env[\"GITHUB_REPOSITORY\"];\n\n if (this.name !== null) {\n if (this.name === \"\") {\n throw new Error(\"The `name` field can't be an empty string\");\n }\n\n const parts = this.name.split(\"/\");\n\n if (parts.length === 1 || parts.length > 2) {\n throw new Error(\"The specified `name` must of the form {org}/{repo}\");\n }\n\n const orgName = parts.at(0);\n const repoName = parts.at(1);\n\n // Fail on mismatched org names only when *not* mirroring\n if (orgName !== org && !this.mirror) {\n throw new Error(\n `The org name \\`${orgName}\\` that you specified using the \\`name\\` input doesn't match the actual org name \\`${org}\\``,\n );\n }\n\n name = `${orgName}/${repoName}`;\n } else {\n name = `${org}/${repo}`;\n }\n\n return name;\n }\n\n async push(): Promise {\n const executionEnv = await this.executionEnvironment();\n\n const binary =\n this.flakeHubPushBinary !== null\n ? this.flakeHubPushBinary\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(binary, [], {\n env: {\n ...executionEnv,\n ...process.env, // To get PATH, etc.\n },\n });\n\n if (exitCode !== 0) {\n this.idslib.recordEvent(EVENT_EXECUTION_FAILURE, {\n exitCode,\n });\n throw new Error(`non-zero exit code of ${exitCode} detected`);\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;AAyB3D,IAAM,qBAAN,MAAyB;AAAA,EAuBvB,cAAc;AACZ,UAAM,UAAyB;AAAA,MAC7B,MAAM;AAAA,MACN,YAAY;AA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,IAC/B,OAAO;AACL,aAAO,GAAG,GAAG,IAAI,IAAI;AAAA,IACvB;AAEA,WAAO;AAAA,EACT;AAAA,EAEA,MAAM,OAAsB;AAC1B,UAAM,eAAe,MAAM,KAAK,qBAAqB;AAErD,UAAM,SACJ,KAAK,uBAAuB,OACxB,KAAK,qBACL,MAAM,KAAK,OAAO,gBAAgB;AAExC,IAAY;AAAA,MACV,0BAA0B,KAAK,UAAU,cAAc,MAAM,CAAC,CAAC;AAAA,IACjE;AAEA,UAAM,WAAW,MAAkB,iBAAK,QAAQ,CAAC,GAAG;AAAA,MAClD,KAAK;AAAA,QACH,GAAG;AAAA,QACH,GAAG,QAAQ;AAAA;AAAA,MACb;AAAA,IACF,CAAC;AAED,QAAI,aAAa,GAAG;AAClB,WAAK,OAAO,YAAY,yBAAyB;AAAA,QAC/C;AAAA,MACF,CAAC;AACD,YAAM,IAAI,MAAM,yBAAyB,QAAQ,WAAW;AAAA,IAC9D;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 diff --git a/ts/index.ts b/ts/index.ts index d7a9252..9c57e68 100644 --- a/ts/index.ts +++ b/ts/index.ts @@ -161,7 +161,8 @@ class FlakeHubPushAction { const orgName = parts.at(0); const repoName = parts.at(1); - if (orgName !== org) { + // Fail on mismatched org names only when *not* mirroring + if (orgName !== org && !this.mirror) { throw new Error( `The org name \`${orgName}\` that you specified using the \`name\` input doesn't match the actual org name \`${org}\``, );