Description
Hello guys,
I discovered an issue with the optimize-bot
as seen in #610. The checkout
and commit
action acts differently when the PR is from a forked repo.
The commit
action calls for the checkout
action to checkout the github.head_ref
when the trigger is pull_request
. Unfortunately, this cause the action to checkout the PR branch's name but look for it in the devicons/devicon
repo => does not exist. The problem is described here.
Removing the github.head_ref
would cause the commit
action to fail entirely but everything else works.
I'd like to ask you guys what you think of the following potential solutions:
-
Changing the
commit
action into acreate-pr
action. This is similar to what we already have in thebuild-fonts
action.- The target will be the PR branch:
- Pro: Don't need to close the branch and keep everything in the same PR
- Con: Might need permission of the owner to merge. If the owner has abandoned the PR, this can be problematic. However, if the owner has abandoned the PR, we'll have to take it over nonetheless and can PR into our own branch.
- The target will be
develop
:- Pro: We can merge it in whenever.
- Con: We'll have to close the old PR manually. PR will also be cluttered
- The target will be the PR branch:
-
Keep the
commit
action but rather than usingfiles-changed
action, manually search for files added based on the PR title.- Pro: Easy to do.
peek-bot
is using this. - Con: Hacky. Depends on PR title to be correct. Will need a wrapper Python script to run the npm script but that's not too bad.
- Pro: Easy to do.
-
Run the
optimize
script another way: on merge, when building, etc...- Pro: Batch things together and save time
- Con: need more work.
I'm thinking of doing option 2. We haven't have an issue with peek-bot
yet. While it's a bit hacky, it works well and I won't have to do much to add this functionality.
What do you guys think?