From 64aa569aea81305305c6e92bd236d8c427debff8 Mon Sep 17 00:00:00 2001 From: Peter Grainger Date: Mon, 14 Nov 2022 15:35:48 +0000 Subject: [PATCH] deprecate set output --- README.md | 10 +++++++++- dist/index.js | 2 ++ src/main.ts | 2 ++ 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index e65ac39..8c57743 100644 --- a/README.md +++ b/README.md @@ -14,10 +14,18 @@ This action creates a new branch with the same commit reference as the branch it ## Outputs -### `created` +### `created` + +***WARNING. DEPRECATED. USE BRANCH_CREATED ENVIRONMENT VARIABLE*** Boolean value representing whether or not a new branch was created. +## Environment Variables Set + +### `BRANCH_CREATED` + +Boolean value representing whether or not a new branch was created. This environment variable can be used in susequent steps in your workflow. + ## Example usage ``` diff --git a/dist/index.js b/dist/index.js index 6264a10..0af2fce 100644 --- a/dist/index.js +++ b/dist/index.js @@ -370,6 +370,8 @@ function run() { core.debug(`Creating branch ${branch}`); const isCreated = yield (0, create_branch_1.createBranch)(github_1.getOctokit, github_1.context, branch, sha); core.setOutput('created', Boolean(isCreated)); + core.warning('Deprecation warning: If you are using the created output, this will be removed in future versions. Please use the BRANCH_CREATED environment variable instead.'); + core.exportVariable('BRANCH_CREATED', Boolean(isCreated)); } catch (error) { core.setFailed(error.message); diff --git a/src/main.ts b/src/main.ts index dfe4853..caf1171 100644 --- a/src/main.ts +++ b/src/main.ts @@ -9,6 +9,8 @@ async function run() { core.debug(`Creating branch ${branch}`); const isCreated = await createBranch(getOctokit, context, branch, sha); core.setOutput('created', Boolean(isCreated)); + core.warning('Deprecation warning: If you are using the created output, this will be removed in future versions. Please use the BRANCH_CREATED environment variable instead.'); + core.exportVariable('BRANCH_CREATED', Boolean(isCreated)); } catch (error: any) { core.setFailed(error.message); }