ad-m / github-push-action

GitHub actions to push back to repository eg. updated code
MIT License
1.21k stars 229 forks source link

Error: Invalid status code: 128 #58

Closed matmu closed 4 years ago

matmu commented 4 years ago

My action

    - name: Push changes to MouseFM-Backend
      uses: ad-m/github-push-action@master
      with:
        repository: matmu/MouseFM-Backend
        directory: MouseFM-Backend
        github_token: ${{ secrets.DEPLOY_PRIVATE_KEY }}

results in an error. The directory, secrets.DEPLOY_PRIVATE_KEY and the repository exists. What is wrong?

Run ad-m/github-push-action@master
Started: bash /home/runner/work/_actions/ad-m/github-push-action/master/start.sh
Push to branch master
warning: url contains a newline in its host component: https://matmu:***
***
***
***
***
***
***
***
***
***
@github.com/matmu/MouseFM-Backend.git/
fatal: credential url cannot be parsed: https://matmu:***
***
***
***
***
***
***
***
***
@github.com/matmu/MouseFM-Backend.git/
Error: Invalid status code: 128
    at ChildProcess.<anonymous> (/home/runner/work/_actions/ad-m/github-push-action/master/start.js:9:19)
    at ChildProcess.emit (events.js:210:5)
    at maybeClose (internal/child_process.js:1021:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:283:5) {
  code: 128
}
Error: Invalid status code: 128
    at ChildProcess.<anonymous> (/home/runner/work/_actions/ad-m/github-push-action/master/start.js:9:19)
    at ChildProcess.emit (events.js:210:5)
    at maybeClose (internal/child_process.js:1021:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:283:5)
ad-m commented 4 years ago

Did you pass SSH key in secrets.DEPLOY_PRIVATE_KEY?

matmu commented 4 years ago

Did you pass SSH key in secrets.DEPLOY_PRIVATE_KEY?

Yes. Just checked it again. Under Settings -> Secrets there is the variable "DEPLOY_PRIVATE_KEY"

ad-m commented 4 years ago

Use GitHub Token instead of SSH keys. See details at https://help.github.com/en/actions/configuring-and-managing-workflows/authenticating-with-the-github_token .

matmu commented 4 years ago

I created a Github Token for my account and updated the secret accordingly. Now I am getting the following error:

Run ad-m/github-push-action@master
Started: bash /home/runner/work/_actions/ad-m/github-push-action/master/start.sh
Push to branch master
remote: Permission to matmu/MouseFM-Backend.git denied to github-actions[bot].
fatal: unable to access 'https://github.com/matmu/MouseFM-Backend.git/': The requested URL returned error: 403
Error: Invalid status code: 128
    at ChildProcess.<anonymous> (/home/runner/work/_actions/ad-m/github-push-action/master/start.js:9:19)
    at ChildProcess.emit (events.js:210:5)
    at maybeClose (internal/child_process.js:1021:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:283:5) {
  code: 128
}
Error: Invalid status code: 128
    at ChildProcess.<anonymous> (/home/runner/work/_actions/ad-m/github-push-action/master/start.js:9:19)
    at ChildProcess.emit (events.js:210:5)
    at maybeClose (internal/child_process.js:1021:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:283:5)

I gave the token full scope.

ad-m commented 4 years ago

Why did you close that issue? Could you share you solution for community?