Skip to content

Commit

Permalink
Bump gitguardian/ggshield from 1.13.5 to 1.13.6 (#26)
Browse files Browse the repository at this point in the history
<!--pre-commit.ci start-->
updates:
- [github.com/gitguardian/ggshield: v1.13.5 →
v1.13.6](GitGuardian/ggshield@v1.13.5...v1.13.6)
<!--pre-commit.ci end-->

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: fabasoad <[email protected]>
  • Loading branch information
pre-commit-ci[bot] and fabasoad authored Oct 31, 2022
1 parent 0b91f44 commit 9da089b
Show file tree
Hide file tree
Showing 5 changed files with 86 additions and 12 deletions.
42 changes: 37 additions & 5 deletions .github/workflows/functional-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,11 @@ on:
- 'feature-**'

jobs:
functional_tests:
name: Install snyk
package_manager:
name: Package manager
timeout-minutes: 5
strategy:
fail-fast: false
matrix:
os: ['macos-latest', 'ubuntu-latest', 'windows-latest']
type: ['npm', 'yarn', 'brew', 'scoop']
Expand All @@ -28,18 +29,49 @@ jobs:
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
with:
ref: ${{ github.ref }}
- name: Setup scoop
if: ${{ matrix.os == 'windows-latest' && matrix.type == 'scoop' }}
uses: MinoruSekine/setup-scoop@main
- name: Configure yarn
if: ${{ matrix.os == 'windows-latest' && matrix.type == 'yarn' }}
run: yarn global bin | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
shell: powershell
- name: Install snyk (${{ matrix.type }})
- name: Install snyk
run: ./hooks/installation/install-${{ matrix.type }}.sh
shell: bash
- name: Print version
run: snyk --version
shell: bash
standalone:
name: Standalone
timeout-minutes: 5
strategy:
fail-fast: false
matrix:
os: ['macos-latest', 'ubuntu-latest', 'windows-latest']
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- name: Install snyk
run: ./hooks/installation/install-standalone.sh
shell: bash
- name: Print version
run: snyk --version
shell: bash
standalone-alpine:
name: Standalone (alpine-latest)
timeout-minutes: 5
runs-on: ubuntu-latest
container:
image: alpine:latest
steps:
- uses: actions/checkout@v3
- name: Install tools
run: apk add bash curl
shell: sh
- name: Install snyk
run: ./hooks/installation/install-standalone.sh
shell: bash
- name: Print version
run: snyk --version
shell: bash
3 changes: 1 addition & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ repos:
- id: gitleaks
stages: ["commit", "push"]
- repo: https://github.com/gitguardian/ggshield
rev: v1.13.5
rev: v1.13.6
hooks:
- id: ggshield
language_version: python3
Expand All @@ -29,7 +29,6 @@ repos:
rev: v0.8.0.4
hooks:
- id: shellcheck
exclude: ^mvnw$
# Yaml
- repo: https://github.com/adrienverge/yamllint
rev: v1.28.0
Expand Down
13 changes: 9 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,16 @@
## Description

Take into account that in case `snyk` is not installed locally it will be
automatically installed **globally**.
automatically installed **globally**. Here is the order of the attempts for
this tool to install `snyk`:

To use any of these hooks **one of the following tools** have to be installed:
[snyk](https://docs.snyk.io/snyk-cli/install-the-snyk-cli), [yarn](https://yarnpkg.com/cli/install),
[npm](https://nodejs.org/en/download/), [brew](https://brew.sh/) or [scoop](https://scoop.sh/).
- [brew](https://brew.sh/), hence it should be installed.
- [scoop](https://scoop.sh/), hence it should be installed.
- [npm](https://nodejs.org/en/download/), hence it should be installed.
- [yarn](https://yarnpkg.com/cli/install), hence it should be installed.
- Standalone installation, for this [curl](https://curl.se/) has to be installed.

If none of the tools above are installed then installation process will fail.

## Documentation

Expand Down
36 changes: 36 additions & 0 deletions hooks/installation/install-standalone.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#!/bin/bash
set -eu

if [[ -f "/etc/alpine-release" ]]; then
binary="snyk-alpine"
path="/usr/local/bin/"
else
case "$(uname -s)" in
Darwin*)
binary="snyk-macos"
path="/usr/local/bin/"
;;
MINGW64*)
binary="snyk-win.exe"
path="C:\Windows\System32"
;;
MSYS_NT*)
binary="snyk-win.exe"
path="C:\Windows\System32"
;;
*)
if [[ "$(uname -m)" == "arm64" ]]; then
binary="snyk-linux-arm64"
else
binary="snyk-linux"
fi
path="/usr/local/bin/"
;;
esac
fi

url="https://static.snyk.io/cli/latest/$binary"
echo "[pre-commit-snyk] GET $url"
curl $url -o snyk
chmod +x ./snyk
mv ./snyk $path
4 changes: 3 additions & 1 deletion hooks/installation/main.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ then
bash "${SCRIPT_DIR}"/install-scoop.sh
elif command -v npm &> /dev/null; then
bash "${SCRIPT_DIR}"/install-npm.sh
else
elif command -v yarn &> /dev/null; then
bash "${SCRIPT_DIR}"/install-yarn.sh
else
bash "${SCRIPT_DIR}"/install-standalone.sh
fi
fi

0 comments on commit 9da089b

Please sign in to comment.