Treblle / treblle-laravel

The official Treblle SDK for Laravel. Seamlessly integrate Treblle to manage communication with your dashboard, send errors, and secure sensitive data.
https://www.treblle.com/
MIT License
129 stars 24 forks source link

Error when "Commit changes" github action step runs on contributed pull request #7

Closed khalyomede closed 2 years ago

khalyomede commented 2 years ago

Description

When a Github user creates a pull request and use its own forked branch as source, the github action step that runs php-cs-fixer fails to find a branch on the destination repository (this one) with the same name as the fork branch name.

See this failure on this pull request for example.

Reproduce the issue

  1. Fork the repository
  2. Create a new branch (that does not exist on the source repository e.g. does not exist on this one)
  3. Create a pull request on the source repository from the fork branch
  4. The "Commit changes" step fails

Expected behavior

No failure when the fork branch code is complying with php-cs-fixer configuration and the fork branch does not exist on the source repository.

bhushan commented 2 years ago

https://github.com/bhushan/Stash-View/blob/master/.github/workflows/php-cs-fixer.yml

Check here @khalyomede .. see if extract branch name helps..

khalyomede commented 2 years ago

Thanks for the link! Actually, I thought about it. What do you think, instead of running php-cs-fixer and commiting in the github action, instead we just check if the pull request passes the lint check?

This would help simplifying the process, with the github action only sticking to validations (maybe in the future it will also run the tests in the same time).

bhushan commented 2 years ago

IMHO its not a good idea.. we are humans ... and we cannot run php-cs-fixer every time before we push code.. i have good experience of that.. but TBH its upto you to decide