Skip to content

Conversation

@CannonLock
Copy link
Contributor

@CannonLock CannonLock commented Sep 15, 2025

Currently the formatter runs on PR's that it cannot edit which is resulting in a error. This update checks that the PR is coming from a branch on this repository and not a fork before it tries to automatically fix things.

Only run the formatter if that action can write to the repository in question.

If it comes form a fork then don't try to auto format.

Here is a example of the action running on a internal branch: #2649

@CannonLock CannonLock requested a review from h2zh September 15, 2025 18:05
@CannonLock CannonLock added the bug Something isn't working label Sep 15, 2025
@h2zh
Copy link
Contributor

h2zh commented Sep 15, 2025

The PR adds a condition to only run the formatter if the pull request's source branch is internal to the repository ( PelicanPlatform/pelican). However, in reality we all create pull request from a fork (i.e. this PR is from CannonLock/pelican, and Format and Push Web UI / format_web_ui (pull_request) was skipped). Does it mean this script will barely run in our daily practices?

@CannonLock
Copy link
Contributor Author

CannonLock commented Sep 15, 2025

@h2zh Yeah, it will barely ever run. I can also just take it out and move it to pre-commit.

@h2zh
Copy link
Contributor

h2zh commented Sep 15, 2025

@CannonLock I agree. Let's move it to pre-commit so that it can actually function, instead of being a ghost bot.

Signed-off-by: Cannon Lock <[email protected]>
@CannonLock
Copy link
Contributor Author

CannonLock commented Sep 16, 2025

@h2zh Done, moved to pre-commit here: #2653

@h2zh h2zh changed the title Only auto format if PR is from internal branch Take out the script that auto formats webUI PR from GitHub Actions Sep 18, 2025
Copy link
Contributor

@h2zh h2zh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. I rename this PR to reflect its up-to-date intent.

@h2zh h2zh merged commit 86737dc into PelicanPlatform:main Sep 18, 2025
24 of 27 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants