Skip to content

Commit

Permalink
fix: check input version before exec cmd
Browse files Browse the repository at this point in the history
ref: #9
  • Loading branch information
mbarre committed Apr 11, 2023
1 parent 870a3e9 commit 02d087b
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 11 deletions.
30 changes: 20 additions & 10 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.

6 changes: 6 additions & 0 deletions lib.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,12 @@ module.exports = async function () {
core.warning(`🆕 DuckDb ${latestVersion} is available.`);
}

const regex = '^v[0-9]*.[0-9]*.[0-9]*$';
if(!selectedVersion.match(regex)) {
core.error("Version not valid.");
throw "Version not valid.";
}

core.info(`📥 Installing DuckDB version : ${selectedVersion}`);
const url = `https://github.com/duckdb/duckdb/releases/download/${selectedVersion}/duckdb_cli-linux-amd64.zip`
const wgetCmd = `wget ${url}`
Expand Down

0 comments on commit 02d087b

Please sign in to comment.