Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
export branch_name=${GITHUB_REF##*/}
echo "branch_name=${branch_name,,}" >> $GITHUB_ENV
echo "commit_sha_short=$(git rev-parse --short "$GITHUB_SHA") >> $GITHUB_ENV"
echo "release=v2.0.1" >> $GITHUB_ENV
echo "release=v2.0.2" >> $GITHUB_ENV

- name: Build image
shell: bash
Expand Down
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,14 @@ jobs:
name: Lint package
steps:
- uses: actions/checkout@v3
- uses: qernal/github-actions-rust-clippy@v2.0.1
- uses: qernal/github-actions-rust-clippy@v2.0.2
```

## Action parameters

| Parameter | Description | Required |
| ---- | ---- | ---- |
| `clippy_args` | Arguments for clippy configuration, comma separated list as "--arg1,--arg2" | N |
| `clippy_args` | Arguments for clippy configuration, space separated list as "--arg1 --arg2" | N |
| `path_glob` | Glob for path finding (when a repository has multiple rust projects) | N |
| `git_ssh_key` | Base64 encoded SSH key used for cargo when private git repositories are specified | N |
| `github_pat` | GitHub PAT (token) for PAT authentication when private git repositories are specified | N |
Expand All @@ -45,7 +45,7 @@ Example;
```yaml
steps:
- uses: actions/checkout@v3
- uses: qernal/github-actions-rust-clippy@v2.0.1
- uses: qernal/github-actions-rust-clippy@v2.0.2
with:
args: "--verbose,--all-targets"
path_glob: "**/src"
Expand All @@ -58,7 +58,7 @@ Example;
You can use the container without the context of the runner, and just run the container like so;

```bash
docker run --rm -v `pwd`:/github/workspace ghcr.io/qernal/gh-actions/rust-clippy-x86_64:v2.0.0
docker run --rm -v `pwd`:/github/workspace ghcr.io/qernal/gh-actions/rust-clippy-x86_64:v2.0.2
```

Replace the `pwd` with your workspace if you're not running from the current directory
Expand All @@ -70,7 +70,7 @@ Replace the `pwd` with your workspace if you're not running from the current dir
In the root of this repository, the following will buuld the container;

```bash
docker build -t ghcr.io/qernal/gh-actions/rust-clippy-x86_64:v2.0.0 -f ./Dockerfile ./
docker build -t ghcr.io/qernal/gh-actions/rust-clippy-x86_64:v2.0.2 -f ./Dockerfile ./
```

### Running Locally
Expand All @@ -79,8 +79,8 @@ The GitHub action call can be simulated locally, an example of this is below;

```bash
# Glob example of multiple cargos
docker run --rm -e INPUT_PATH_GLOB=src/functions/*/*/ -e INPUT_THREADS=4 -e INPUT_GIT_SSH_KEY="$(cat ~/.ssh/my_key | base64 -w0)" -v `pwd`:/github/workspace ghcr.io/qernal/gh-actions/rust-clippy-x86_64:v2.0.1
docker run --rm -e INPUT_PATH_GLOB=src/functions/*/*/ -e INPUT_THREADS=4 -e INPUT_GIT_SSH_KEY="$(cat ~/.ssh/my_key | base64 -w0)" -v `pwd`:/github/workspace ghcr.io/qernal/gh-actions/rust-clippy-x86_64:v2.0.2

# Specifiying rust version
docker run --rm -e INPUT_RUST_VERSION=1.56 -e INPUT_THREADS=4 -e INPUT_GIT_SSH_KEY="$(cat ~/.ssh/my_key | base64 -w0)" -v `pwd`:/github/workspace ghcr.io/qernal/gh-actions/rust-clippy-x86_64:v2.0.1
docker run --rm -e INPUT_RUST_VERSION=1.56 -e INPUT_THREADS=4 -e INPUT_GIT_SSH_KEY="$(cat ~/.ssh/my_key | base64 -w0)" -v `pwd`:/github/workspace ghcr.io/qernal/gh-actions/rust-clippy-x86_64:v2.0.2
```
2 changes: 1 addition & 1 deletion action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,4 @@ inputs:

runs:
using: 'docker'
image: 'docker://ghcr.io/qernal/gh-actions/rust-clippy-x86_64:v2.0.1'
image: 'docker://ghcr.io/qernal/gh-actions/rust-clippy-x86_64:v2.0.2'
2 changes: 1 addition & 1 deletion src/clippy.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ def __init__(self):
self.config['path_glob'] = arg_path_glob

if arg_clippy_args != None and len(arg_clippy_args) > 0:
self.args += arg_clippy_args.split(',')
self.args += shlex.split(arg_clippy_args)

if arg_threads != None and arg_threads.isdigit():
self.config['threads'] = int(arg_threads)
Expand Down