Skip to content

Commit

Permalink
build github action distribution
Browse files Browse the repository at this point in the history
  • Loading branch information
socheatsok78 committed Jun 1, 2024
1 parent 07ec89e commit 1a12636
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 25 deletions.
25 changes: 13 additions & 12 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

25 changes: 13 additions & 12 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,26 +83,27 @@ async function main() {
} // if (Object.hasOwnProperty.call(data, key))
} // for (const key in data)

// Clean up matrix if does not contain any values
for (const key in matrix) {
if (matrix[key].length === 0) {
delete matrix[key]
}
}

// Set outputs matrix
if (matrix.releases.length && matrix.versions.length) {
core.info("Result:")
core.info("----------------------------------------")
core.info(JSON.stringify(matrix))
core.info("----------------------------------------")
core.setOutput("matrix", JSON.stringify(matrix));
// Check if matrix.releases is not empty
if (matrix.releases.length) {
core.setOutput("releases", JSON.stringify(matrix.releases));
} else {
delete matrix.releases
}

// Check if matrix.versions is not empty
if (matrix.versions.length) {
core.setOutput("versions", JSON.stringify(matrix.versions));
} else {
delete matrix.versions
}

core.info("Result:")
core.info("----------------------------------------")
core.info(JSON.stringify(matrix))
core.info("----------------------------------------")
core.setOutput("matrix", JSON.stringify(matrix));
} else {
core.error([
"No result found for the given query, please check the input values or the source data.",
Expand Down

0 comments on commit 1a12636

Please sign in to comment.