reviewdog / action-suggester Goto Github PK
View Code? Open in Web Editor NEW:dog: Suggests any code changes based on diff through GitHub Multi-line code suggestions by using reviewdog
License: MIT License
:dog: Suggests any code changes based on diff through GitHub Multi-line code suggestions by using reviewdog
License: MIT License
This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.
This repository currently has no open or pending branches.
.github/workflows/depup.yml
actions/checkout v4
reviewdog/action-depup v1
actions/checkout v4
shogo82148/actions-commit-and-create-pr v1
.github/workflows/release.yml
actions/checkout v4
haya14busa/action-bumpr v1
haya14busa/action-update-semver v1
haya14busa/action-cond v1
actions/checkout v4
haya14busa/action-bumpr v1
.github/workflows/reviewdog.yml
actions/checkout v4
haya14busa/action-cond v1
reviewdog/action-shellcheck v1
actions/checkout v4
reviewdog/action-shfmt v1
actions/checkout v4
reviewdog/action-actionlint v1
actions/checkout v4
reviewdog/action-misspell v1
actions/checkout v4
reviewdog/action-alex v1
.github/workflows/test.yml
actions/checkout v4
actions/checkout v4
actions/setup-go v5
How can I use this action suggester with action-rubocop and github actions?
This is my .rubocop.yml file
name: Rubocop
on: [pull_request]
jobs:
rubocop:
name: Rubocop
runs-on: ubuntu-latest
env:
RAILS_ENV: development
steps:
- name: Check out code
uses: actions/checkout@v1
- uses: ruby/setup-ruby@v1
with:
ruby-version: 2.5.8
- name: rubocop
uses: reviewdog/action-rubocop@v1
with:
rubocop_version: gemfile
rubocop_extensions: rubocop-rails:gemfile rubocop-rspec:gemfile
github_token: ${{ secrets.github_token }}
reporter: github-pr-review
I would like to use reviewdog in a workflow that is not directly triggered by a Pull Request but only indirectly, by another workflow which is triggered by a PR. I'm trying to copy langchain4j/langchain4j#673 but with reviewdog instead of the google code suggester. Security concerns are the reason to split formatting and suggesting into different workflows. But for all I've tried I couldn't make reviewdog work when the request wasn't triggered by a Pull Request.
Is this by design? Then please consider this a feature request: The action should also work when triggered by workflow_run
.
If it is not by design and is actually supposed to work could you please have a look at https://github.com/timo-a/jackson-core/actions/runs/8638440591/job/23682897275?
The logs say reviewdog: this is not PullRequest build.
The workflow is: https://github.com/timo-a/jackson-core/blob/a847f5e655643e98242f40fad57ec6c23dd490c6/.github/workflows/comment-pr.yml and depends on https://github.com/timo-a/jackson-core/blob/a847f5e655643e98242f40fad57ec6c23dd490c6/.github/workflows/receive-pr.yml.
Other Workflows do make a suggestion on timo-a/jackson-core#2 however they are all triggered by a pull_request
Hello,
I got an issue while working on input-output-hk/haskell.nix#1983, you can see the logs here:
Run reviewdog/action-suggester@v1
with:
tool_name: deadnix
github_token: ***
level: warning
filter_mode: diff_context
fail_on_error: false
cleanup: true
env:
NIX_PATH: nixpkgs=channel:nixos-unstable
Run reviewdog/action-setup@v1
with:
reviewdog_version: v0.14.2
env:
NIX_PATH: nixpkgs=channel:nixos-unstable
Run $GITHUB_ACTION_PATH/install.sh
$GITHUB_ACTION_PATH/install.sh
shell: /nix/store/8fv91097mbh5049i9rglc73dx6kjg3qk-bash-5.2-p15/bin/bash --noprofile --norc -e -o pipefail {0}
env:
NIX_PATH: nixpkgs=channel:nixos-unstable
REVIEWDOG_VERSION: v0.14.2
REVIEWDOG_TEMPDIR: /run/github-runner/runner1/_temp
/run/github-runner/runner1/_temp/4afc4738-e60d-4450-b422-c30a1edec6b7.sh: line 1: /run/github-runner/runner1/_actions/reviewdog/action-setup/v1/install.sh: cannot execute: required file not found
Error: Process completed with exit code 127.
โฆ which is surprising since my workflow code is pretty straightforward, where the issue could potentially come from?
deadnix:
runs-on: [self-hosted, linux]
steps:
- uses: actions/checkout@v3
- run: nix run github:astro/deadnix -- --edit --no-lambda-pattern-names
- uses: reviewdog/action-suggester@v1
with:
tool_name: deadnix
Hi,
Could we please document which permissions
that's needed to be able to use this action?
Docs for this is here:
Would it be possible to support the newly added github-pr-annotations
reporter? (Requires reviewdog 0.17.0 onwards)
see https://github.com/reviewdog/action-suggester/actions/runs/5253534837/jobs/9490984742?pr=29
go: downloading mvdan.cc/sh v1.3.1
go: downloading mvdan.cc/sh/v3 v3.6.0
go: downloading mvdan.cc/sh v2.6.4+incompatible
go: downloading github.com/google/renameio/v2 v2.0.0
go: downloading github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e
go: downloading golang.org/x/term v0.3.0
go: downloading mvdan.cc/editorconfig v0.2.0
go: downloading golang.org/x/sys v0.3.0
# golang.org/x/sys/unix
Error: ../../../go/pkg/mod/golang.org/x/[email protected]/unix/syscall.go:83:16: undefined: unsafe.Slice
Error: ../../../go/pkg/mod/golang.org/x/[email protected]/unix/syscall_linux.go:2256:9: undefined: unsafe.Slice
Error: ../../../go/pkg/mod/golang.org/x/[email protected]/unix/syscall_unix.go:118:7: undefined: unsafe.Slice
Error: ../../../go/pkg/mod/golang.org/x/[email protected]/unix/sysvshm_unix.go:33:7: undefined: unsafe.Slice
note: module requires Go 1.17
# mvdan.cc/sh/v3/fileutil
Error: ../../../go/pkg/mod/mvdan.cc/sh/[email protected]/fileutil/file.go:65:24: undefined: fs.FileInfoToDirEntry
note: module requires Go 1.18
Error: Process completed with exit code 2.
We use Go 1.16 now, whether it doesn't support unsafe.Slice
.
unsafe.Slice
requires Go 1.17: https://pkg.go.dev/unsafe#Slice
The set-output
command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
The action script contains set -e
which tells bash to exit if any command fails:
Line 2 in 3d7fde6
Further down however it expects to be able to capture the exit code of executing the reviewdog binary:
Line 26 in 3d7fde6
But any non zero code would cause a termination before reaching that line.
Essentially the following might give the impression that some cleanup is done if the reviewdog command fails, but it's not, if the exit code is anything other than 0, the following block never gets run:
EXIT_CODE=$?
if [ "${INPUT_CLEANUP}" = "true" ]; then
git stash drop || true
else
git stash pop || true
fi
exit "${EXIT_CODE}"
Previously there was an || EXIT_CODE=$?
that was removed as part of https://github.com/reviewdog/action-suggester/pull/31/files but this doesn't see correct if errexit
is set
Instead it would appear that the command should use an &&
as well as an ||
to capture the exit code on the same line and ensure the line exit code is 0:
reviewdog \
-name="${INPUT_TOOL_NAME:-reviewdog-suggester}" \
-f=diff \
-f.diff.strip=1 \
-reporter="github-pr-review" \
-filter-mode="${INPUT_FILTER_MODE}" \
-fail-on-error="${INPUT_FAIL_ON_ERROR}" \
-level="${INPUT_LEVEL}" \
${INPUT_REVIEWDOG_FLAGS} <"${TMPFILE}" && EXIT_CODE=$? || EXIT_CODE=$?
First of all, thanks for the massive efforts around reviewdog. It's in plain sight the amount of work you poured in for everybody to enjoy.
I have been trying to set reviewdog in my CI on Github Actions and I only managed to get reports in the PR like this:
But never to get code comments/suggestions.
This is my current action file:
name: reviewdog
on: [pull_request]
jobs:
eslint:
runs-on: ubuntu-latest
name: runner / eslint
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
token: ${{ secrets.CI_ACCESS_TOKEN }}
- uses: reviewdog/action-setup@v1
with:
reviewdog_version: latest
- uses: reviewdog/action-eslint@v1
env:
REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
reporter: github-pr-review
level: error
filter_mode: added
- uses: reviewdog/action-suggester@v1
with:
tool_name: eslint
Is there anything I'm missing?
In my understanding the reviewdog/action-eslint@v1
action will output the result and the reviewdog/action-suggester@v1
will print it as comments/suggestions. But really can't manage to make this work ๐คท๐ปโโ๏ธ
Thank you so much for any help.
Version: 1.13.0
๐ถ Installing reviewdog ... https://github.com/reviewdog/reviewdog
reviewdog/reviewdog info checking GitHub for tag 'v0.17.5'
reviewdog/reviewdog crit unable to find 'v0.17.5' - use 'latest' or see https://github.com/reviewdog/reviewdog/releases for details
Error: Process completed with exit code 1.
I am currently trying to workout best way to deal with JuliaDiff/ChainRulesCore.jl#489
where the suggester action doesn't have the permissions needed to make a suggestion to a PR from a fork.
One thing that might help is if I could define a string so that every comment make using the check fallback (that doesn't allow the "apply suggestion") includes that string, which would be something like:
To automatically format the whole repo (and thus fix this and other issues) run
...
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.