Skip to content

Commit

Permalink
Add input for setting detect-secrets version (#58)
Browse files Browse the repository at this point in the history
* Add env support for detect-secrets version

* Add detect_secrets_version input

* Update CI with test for explicit version

* Add env for docker container
  • Loading branch information
javierjulio authored Feb 14, 2024
1 parent 7adc60e commit 1a35133
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 2 deletions.
12 changes: 12 additions & 0 deletions .github/workflows/reviewdog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,15 @@ jobs:
github_token: ${{ secrets.github_token }}
reporter: github-pr-review
workdir: testdata

detect-secrets-version:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: detect-secrets
uses: ./
with:
detect_secrets_version: "1.3.0"
github_token: ${{ secrets.github_token }}
reporter: github-pr-review
workdir: testdata
9 changes: 7 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,13 @@ RUN set -eux \
&& apt-get install -y --no-install-recommends \
git \
wget \
&& wget -O - -q https://raw.githubusercontent.com/reviewdog/reviewdog/master/install.sh| sh -s -- -b /usr/local/bin/ ${REVIEWDOG_VERSION} \
&& pip install detect-secrets[word_list]
&& wget -O - -q https://raw.githubusercontent.com/reviewdog/reviewdog/master/install.sh| sh -s -- -b /usr/local/bin/ ${REVIEWDOG_VERSION}

RUN if [ -n "$INPUT_DETECT_SECRETS_VERSION" ]; then \
pip install detect-secrets[word_list]=="$INPUT_DETECT_SECRETS_VERSION"; \
else \
pip install detect-secrets[word_list]; \
fi

COPY baseline2rdf.py /usr/local/bin/baseline2rdf
COPY entrypoint.sh /entrypoint.sh
Expand Down
5 changes: 5 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ inputs:
detect_secrets_flags:
description: Flags and args of detect-secrets command. The default is '--all-files --force-use-all-plugins'.
default: --all-files --force-use-all-plugins
detect_secrets_version:
description: The detect-secrets version to install. By default will install the latest version.
default: ""
baseline_path:
description: The baseline path to update. If not provided, a new baseline will be created.
default: ""
Expand All @@ -43,6 +46,8 @@ inputs:
runs:
using: docker
image: Dockerfile
env:
INPUT_DETECT_SECRETS_VERSION: ${{ inputs.detect_secrets_version }}
branding:
icon: shield
color: green

0 comments on commit 1a35133

Please sign in to comment.