rtCamp / action-phpcs-code-review

Github Action to perform automated code review on pull requests
https://github.com/rtCamp/github-actions-library
MIT License
103 stars 27 forks source link

Trying to use action on push. #46

Closed sdwru closed 3 years ago

sdwru commented 3 years ago

Getting this error on push. I think it is because it is not grabbing the commit id. I changed ${{ github.event.pull_request.head.sha }} to ${{ github.sha }}. Is there anything else I should do or maybe this won't work on push?

...
...
Running the following command
/home/rtbot/vip-go-ci-tools/vip-go-ci/vip-go-ci.php --repo-owner=sdwru --repo-name=somerepname --commit=null --token=$GH_BOT_TOKEN --phpcs-path=/home/rtbot/vip-go-ci-tools/phpcs/bin/phpcs --local-git-repo=/home/rtbot/github-workspace --phpcs=true --phpcs-standard=/home/rtbot/github-workspace/phpcs.xml --phpcs-sniffs-exclude='WordPress.Files.FileName' --skip-folders='tests,.github' --lint=true
[ 2021-02-22T22:59:34+05:30 -- 0 ]  Initializing...; {
    "debug_info": {
        "vipgoci_version": "0.38",
        "php_version": "7.4.7",
        "hostname": "f07ce0924bc3",
        "php_uname": "Linux f07ce0924bc3 5.4.0-1039-azure #41~18.04.1-Ubuntu SMP Mon Jan 18 14:00:01 UTC 2021 x86_64"
    }
}
...
...
[ 2021-02-22T22:59:34+05:30 -- 0 ]  Can not use local Git repository, seems not to be in sync with current commit or does not exist; {
    "commit_id": "null",
    "local_git_repo": "\/home\/rtbot\/github-workspace",
    "local_git_repo_head": "51777ff6cca7b2a24738e6543b5128f27c51296e"
}

I set up everything exactly according to the instructions as far as I can tell. I am using the phpcs.yml example given in my .github/workflow directory.

mrrobot47 commented 3 years ago

This action runs only for PRs. https://github.com/rtCamp/action-phpcs-code-review#limitations

This action is configured to take the diff. of code in pull request and if any issue is found then it comments (with requested change) on the pull request regarding the phpcs issue.

This process is not possible via push trigger. Hence it will not run on push.