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

##[error]Docker run failed with exit code 253 #23

Closed MDaskalovAtBE closed 4 years ago

MDaskalovAtBE commented 4 years ago

Hi, I think that has been reported before and closed after fix but the latest changes might have reverted the fix or so....

When I use the uses: docker://rtcamp/action-phpcs-code-review:v2.0.0

Can not use local Git repository, seems not to be in sync with current commit or does not exist; I have COMMIT ID: null when reviewing the action.

When i saw that at first I've fixed it by switching to master. But now seems to fail aswel.

Can you please amend that on both master and the version tag, any future fixes, features could pump up the version tag like v2.0.1 so if the rest are having it working at 2.0.0 there will be no need to amend/upgrade until we feel the need.

mrrobot47 commented 4 years ago

Hey @MDaskalovAtBE, thanks for reporting the issue. Can you please share the workflow file that you are using. It would be easier to re-create and debug the issue that you are facing.

Also, just as a precaution. Can you check that the checkout action is tagged to v2 with the correct ref as shown below.

actions/checkout should be tagged to @v2 and have the given ref:

    - uses: actions/checkout@v2
      with:
        ref: ${{ github.event.pull_request.head.sha }}

The complete workflow file, from the readme:

name: Run PHPCS on pull requests

on: pull_request

jobs:
  phpcs:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v2
      with:
        ref: ${{ github.event.pull_request.head.sha }}
    - uses: docker://rtcamp/action-phpcs-code-review:v2.0.0
      env:
        GH_BOT_TOKEN: ${{ secrets.GH_BOT_TOKEN }}
      with:
        args: "WordPress,WordPress-Core,WordPress-Docs"
MDaskalovAtBE commented 4 years ago

Hi @mrrobot47

Thanks a lot for the quick response.

Currently I have -

name: PHP Code Sniffer

on: push

jobs:
 phpcs:

   runs-on: ubuntu-18.04

   steps:
   - uses: actions/checkout@v2
     with:
       ref: ${{ github.event.pull_request.head.sha }}
   - uses: docker://rtcamp/action-phpcs-code-review:v2.0.0
     env:
       GH_BOT_TOKEN: ${{ secrets.GH_BOT_TOKEN }}
     with:
       args: "PSR12"
mrrobot47 commented 4 years ago

@MDaskalovAtBE this action should be triggered only on: pull_request

This action checks for the phpcs errors on Pull Requests and has the logic to comment on Pull Requests if errors are found. While running it on: push it will not get any pull requests to run the sniffing on.

So, it will not work. Please update on: push to on: pull_request in your workflow file to resolve your issue.

MDaskalovAtBE commented 4 years ago

Ok, that worked, thanks a lot!

Just wondering what has changed recently? This line hasn't been changed in my yml but it stopped working.

mrrobot47 commented 4 years ago

The major change was only the action checkout update with the ref. No other breaking changes after that issue.

Closing this as the issue has been resolved.