Last active
July 6, 2024 17:18
-
-
Save crashGoBoom/04e30ba343948a5c84e8079cf4c64dd2 to your computer and use it in GitHub Desktop.
Install codeql for MacOS (BigSur)
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
#!/bin/bash | |
# Check for latest release: https://github.com/github/codeql-cli-binaries/releases | |
_version='v2.4.1' | |
_arch='osx' | |
_zip_url="https://github.com/github/codeql-cli-binaries/releases/download/${_version}/codeql-${_arch}64.zip" | |
_dir='codeql-home' | |
_cores=2 | |
pushd "${HOME}" || exit | |
# Download and extract into | |
curl -o "${_dir}.zip" "${_zip_url}" -L | |
# Unzips to codeql/ | |
unzip "${_dir}.zip" | |
# Change the name | |
mv codeql/ "${_dir}/" | |
pushd "${_dir}/" || exit | |
# Grab the repo for the examples and query suites. You'll need these! | |
git clone https://github.com/github/codeql.git codeql-repo | |
ln -s "${HOME}/${_dir}/codeql" /usr/local/bin/codeql | |
echo "YAY! codeql is now installed!" | |
codeql --help | |
echo "Now run the following to create a db:" | |
echo "cd yourrepo/; codeql database create yourrepo-db --language=javascript" | |
echo "Now you can analyze!" | |
echo "codeql database analyze /yourrepo/yourrepo-db $HOME/codeql-home/codeql-repo/javascript/ql/src/codeql-suites/javascript-security-and-quality.qls --format=csv --output=sec-quality.csv -j $_cores" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment