Skip to content

Commit

Permalink
Adding output variables
Browse files Browse the repository at this point in the history
  • Loading branch information
AshanFernando committed Sep 24, 2024
1 parent 76052c9 commit 76cd19c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5938,9 +5938,12 @@ const run = (wsdir, skipDepInstall, skipBitInstall, args) => __awaiter(void 0, v
const defaultScope = workspaceObject["teambit.workspace/workspace"].defaultScope;
const [Org, Scope] = defaultScope.split(".");
process.env.ORG = Org;
core.setOutput("org", Org);
process.env.SCOPE = Scope;
core.setOutput("scope", Scope);
// get bitEngineVersion from workspace.jsonc
bitEngineVersion = ((_a = workspaceObject["teambit.harmony/bit"]) === null || _a === void 0 ? void 0 : _a.engine) || "";
core.setOutput("engine", bitEngineVersion);
}
else {
// Log a warning if workspace.jsonc is missing
Expand All @@ -5958,6 +5961,7 @@ const run = (wsdir, skipDepInstall, skipBitInstall, args) => __awaiter(void 0, v
});
installedBitVersion = installedBitVersion.trim();
core.info(`Bit version ${installedBitVersion} is available on the build agent.`);
core.setOutput("bit", installedBitVersion);
}
catch (error) {
installedBitVersion = "";
Expand Down
4 changes: 4 additions & 0 deletions scripts/init.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,13 @@ const run = async (
workspaceObject["teambit.workspace/workspace"].defaultScope;
const [Org, Scope] = defaultScope.split(".");
process.env.ORG = Org;
core.setOutput("org", Org);
process.env.SCOPE = Scope;
core.setOutput("scope", Scope);

// get bitEngineVersion from workspace.jsonc
bitEngineVersion = workspaceObject["teambit.harmony/bit"]?.engine || "";
core.setOutput("engine", bitEngineVersion);
} else {
// Log a warning if workspace.jsonc is missing
core.warning(
Expand All @@ -48,6 +51,7 @@ const run = async (
core.info(
`Bit version ${installedBitVersion} is available on the build agent.`
);
core.setOutput("bit", installedBitVersion);
} catch (error) {
installedBitVersion = "";
}
Expand Down

0 comments on commit 76cd19c

Please sign in to comment.