dbm03 / cs2340-project-2

https://barrosodavid.github.io/cs2340-project-2/
1 stars 0 forks source link

Formatting GitHub action failing when merging to main branch #5

Closed dbm03 closed 6 months ago

dbm03 commented 6 months ago

Describe the bug Formatting GitHub action fails when merging from a branch into main, when making a commit squash with formatted code into the previous commit.

To Reproduce Steps to reproduce the behavior:

  1. Open pull request
  2. Merge to main
  3. Formatting Action fails
  4. See error

Expected behavior Formatting workflow should be able to apply reformat to the previous commit

Screenshots image

nekronos-gh commented 6 months ago

I know what the problem is. We disabled pushing into main, so the github actions bot is unable to push the formatting changes. I have no idea how to solve this...

dbm03 commented 6 months ago

I'm taking a look at these:

https://github.com/orgs/community/discussions/25305#top

https://github.com/CasperWA/push-protected

nekronos-gh commented 6 months ago

This one looks good, but I do not have the privileges to make this happen:

https://stackoverflow.com/questions/69263843/how-to-push-to-protected-main-branches-in-a-github-action

dbm03 commented 6 months ago

One solution could be to disable the formatting workflow when we're on the main branch.

The code should be formatted already when accepting the pull request from a different branch right?

dbm03 commented 6 months ago

This one looks good, but I do not have the privileges to make this happen:

https://stackoverflow.com/questions/69263843/how-to-push-to-protected-main-branches-in-a-github-action

Awesome, I'll add it to the repo

nekronos-gh commented 6 months ago

One solution could be to disable the formatting workflow when we're on the main branch.

The code should be formatted already when accepting the pull request from a different branch right?

Yeah, It should have been previously formatted before the pull request.

dbm03 commented 6 months ago

I prefer to disable the formatting in the main branch, as the other solution requires making a new GitHub account or registering an organization

nekronos-gh commented 6 months ago

Sounds good

dbm03 commented 6 months ago

Let's keep it open until we are 100% sure it works

nekronos-gh commented 6 months ago

By now this should have been fixed