Skip to content

Commit

Permalink
fix: issue with variable name
Browse files Browse the repository at this point in the history
  • Loading branch information
antifree committed Jan 11, 2024
1 parent 2f54a3b commit 621142e
Show file tree
Hide file tree
Showing 380 changed files with 42 additions and 147,981 deletions.
19 changes: 16 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ on:
workflow_dispatch:

jobs:
test_job:
test_with_prefix_job:
runs-on: ubuntu-latest
name: A job to test action
name: A job to test action with prefix
steps:
- uses: actions/checkout@v2
- name: JSON to variables
Expand All @@ -15,4 +15,17 @@ jobs:
filename: 'test.json'
prefix: test
- name: Show output
run: echo "The time was ${{ env.test_value }}, ${{ env.test_array_0_value }}, ${{ env.test_obj_value1 }}"
run: echo "The time was ${{ env.test_value }}, ${{ env.test_array_0_value }}, ${{ env.test_obj_value1 }}"

test_without_prefix_job:
runs-on: ubuntu-latest
name: A job to test action without prefix
steps:
- uses: actions/checkout@v2
- name: JSON to variables
uses: antifree/json-to-variables@HEAD
with:
filename: 'test.json'
- name: Show output
run: echo "The time was ${{ env.value }}, ${{ env.array_0_value }}, ${{ env.obj_value1 }}"

35 changes: 17 additions & 18 deletions dist/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/******/ (() => { // webpackBootstrap
/******/ var __webpack_modules__ = ({

/***/ 777:
/***/ 103:
/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {

"use strict";
Expand All @@ -15,7 +15,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
};
Object.defineProperty(exports, "__esModule", ({ value: true }));
const os = __importStar(__nccwpck_require__(37));
const utils_1 = __nccwpck_require__(855);
const utils_1 = __nccwpck_require__(543);
/**
* Commands
*
Expand Down Expand Up @@ -87,7 +87,7 @@ function escapeProperty(s) {

/***/ }),

/***/ 181:
/***/ 885:
/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {

"use strict";
Expand All @@ -109,9 +109,9 @@ var __importStar = (this && this.__importStar) || function (mod) {
return result;
};
Object.defineProperty(exports, "__esModule", ({ value: true }));
const command_1 = __nccwpck_require__(777);
const file_command_1 = __nccwpck_require__(679);
const utils_1 = __nccwpck_require__(855);
const command_1 = __nccwpck_require__(103);
const file_command_1 = __nccwpck_require__(531);
const utils_1 = __nccwpck_require__(543);
const os = __importStar(__nccwpck_require__(37));
const path = __importStar(__nccwpck_require__(17));
/**
Expand Down Expand Up @@ -332,7 +332,7 @@ exports.getState = getState;

/***/ }),

/***/ 679:
/***/ 531:
/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {

"use strict";
Expand All @@ -350,7 +350,7 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
/* eslint-disable @typescript-eslint/no-explicit-any */
const fs = __importStar(__nccwpck_require__(147));
const os = __importStar(__nccwpck_require__(37));
const utils_1 = __nccwpck_require__(855);
const utils_1 = __nccwpck_require__(543);
function issueCommand(command, message) {
const filePath = process.env[`GITHUB_${command}`];
if (!filePath) {
Expand All @@ -368,7 +368,7 @@ exports.issueCommand = issueCommand;

/***/ }),

/***/ 855:
/***/ 543:
/***/ ((__unused_webpack_module, exports) => {

"use strict";
Expand Down Expand Up @@ -461,7 +461,7 @@ var __webpack_exports__ = {};
(() => {
const fs = __nccwpck_require__(147);
const path = __nccwpck_require__(17);
const core = __nccwpck_require__(181);
const core = __nccwpck_require__(885);

try {
const fileName = core.getInput('filename', { required: true });
Expand All @@ -485,21 +485,20 @@ try {
}
else if (typeof variable === 'object') {
for(const key in variable) {
if(rootObj.hasOwnProperty(key)){
processVariable(variable[key], key);
}
else {
processVariable(variable[key], `${name}_${key}`);
}
const variableName = (rootObj.hasOwnProperty(key) || name.length > 0)
key
: `${name}_${key}`

processVariable(variable[key], variableName);
}
}
else {
core.info(`SET ENV '${prefix}${name}' = ${variable}`);
core.info(`SET ENV '${name}' = ${variable}`);
core.exportVariable(name, variable.toString());
}
};

processVariable(rootObj);
processVariable(rootObj, prefix);

} catch (error) {
core.setFailed(error.message);
Expand Down
9 changes: 0 additions & 9 deletions node_modules/@actions/core/LICENSE.md

This file was deleted.

147 changes: 0 additions & 147 deletions node_modules/@actions/core/README.md

This file was deleted.

16 changes: 0 additions & 16 deletions node_modules/@actions/core/lib/command.d.ts

This file was deleted.

79 changes: 0 additions & 79 deletions node_modules/@actions/core/lib/command.js

This file was deleted.

1 change: 0 additions & 1 deletion node_modules/@actions/core/lib/command.js.map

This file was deleted.

Loading

0 comments on commit 621142e

Please sign in to comment.