-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
993a062
commit 2240ff2
Showing
8 changed files
with
115 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
yarn 1.17.3 | ||
nodejs 16.16.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# Expose JSON Outputs | ||
|
||
This action exposes JSON input as a set of outputs. | ||
|
||
## Expose JSON as outputs | ||
|
||
Proxies JS shared action outputs from composite actions. See gsm-secrets as an example of the issue. | ||
|
||
### Inputs | ||
|
||
The list of arguments, that are used in GH Action: | ||
|
||
| name | type | required | default | description | | ||
| ------ | ------ | -------- | ------- | ---------------------- | | ||
| `json` | string | ✅ | | JSON string to process | | ||
|
||
## Contributing | ||
|
||
We would love for you to contribute to `toptal/actions/tree/main/expose-json-outputs`, pull requests are welcome! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
name: 'Expose JSON as outputs' | ||
description: 'Proxies JS shared action outputs from composite actions. See gsm-secrets as an example of the issue.' | ||
author: 'Dev X' | ||
inputs: | ||
json: | ||
description: 'JSON string to process' | ||
required: true | ||
# outputs are intentionally not declared due to the dynamic nature of the outputs | ||
# outputs: | ||
runs: | ||
using: 'node16' | ||
main: 'dist/index.js' |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
{ | ||
"name": "expose-json-outputs", | ||
"version": "1.0.0", | ||
"description": "Exposes JSON input as a set of outputs", | ||
"main": "dist/index.js", | ||
"private": true, | ||
"scripts": { | ||
"build": "ncc build --minify -o dist src/index.js" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/toptal/davinci-github-actions.git" | ||
}, | ||
"keywords": [ | ||
"actions", | ||
"node", | ||
"json" | ||
], | ||
"author": "Dev X", | ||
"bugs": { | ||
"url": "https://github.com/toptal/davinci-github-actions/issues" | ||
}, | ||
"homepage": "https://github.com/toptal/davinci-github-actions/expose-json-outputs#readme", | ||
"dependencies": { | ||
"@actions/core": "^1.10.0" | ||
}, | ||
"devDependencies": { | ||
"@vercel/ncc": "^0.36.1" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
const core = require('@actions/core') | ||
|
||
try { | ||
const jsonString = core.getInput('json') | ||
core.debug(`json: ${jsonString}`) | ||
const jsonObj = JSON.parse(jsonString) | ||
|
||
for (const key in jsonObj) { | ||
if (jsonObj.hasOwnProperty(key)) { | ||
core.setOutput(key, jsonObj[key]) | ||
} | ||
} | ||
} catch (error) { | ||
core.setFailed(error.message) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. | ||
# yarn lockfile v1 | ||
|
||
|
||
"@actions/core@^1.10.0": | ||
version "1.10.0" | ||
resolved "https://registry.yarnpkg.com/@actions/core/-/core-1.10.0.tgz#44551c3c71163949a2f06e94d9ca2157a0cfac4f" | ||
integrity sha512-2aZDDa3zrrZbP5ZYg159sNoLRb61nQ7awl5pSvIq5Qpj81vwDzdMRKzkWJGJuwVvWpvZKx7vspJALyvaaIQyug== | ||
dependencies: | ||
"@actions/http-client" "^2.0.1" | ||
uuid "^8.3.2" | ||
|
||
"@actions/http-client@^2.0.1": | ||
version "2.1.0" | ||
resolved "https://registry.yarnpkg.com/@actions/http-client/-/http-client-2.1.0.tgz#b6d8c3934727d6a50d10d19f00a711a964599a9f" | ||
integrity sha512-BonhODnXr3amchh4qkmjPMUO8mFi/zLaaCeCAJZqch8iQqyDnVIkySjB38VHAC8IJ+bnlgfOqlhpyCUZHlQsqw== | ||
dependencies: | ||
tunnel "^0.0.6" | ||
|
||
"@vercel/ncc@^0.36.1": | ||
version "0.36.1" | ||
resolved "https://registry.yarnpkg.com/@vercel/ncc/-/ncc-0.36.1.tgz#d4c01fdbbe909d128d1bf11c7f8b5431654c5b95" | ||
integrity sha512-S4cL7Taa9yb5qbv+6wLgiKVZ03Qfkc4jGRuiUQMQ8HGBD5pcNRnHeYM33zBvJE4/zJGjJJ8GScB+WmTsn9mORw== | ||
|
||
tunnel@^0.0.6: | ||
version "0.0.6" | ||
resolved "https://registry.yarnpkg.com/tunnel/-/tunnel-0.0.6.tgz#72f1314b34a5b192db012324df2cc587ca47f92c" | ||
integrity sha512-1h/Lnq9yajKY2PEbBadPXj3VxsDDu844OnaAo52UVmIzIvwwtBPIuNvkjuzBlTWpfJyUbG3ez0KSBibQkj4ojg== | ||
|
||
uuid@^8.3.2: | ||
version "8.3.2" | ||
resolved "https://registry.yarnpkg.com/uuid/-/uuid-8.3.2.tgz#80d5b5ced271bb9af6c445f21a1a04c606cefbe2" | ||
integrity sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg== |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters