LLNL / serac

Serac is a high order nonlinear thermomechanical simulation code
BSD 3-Clause "New" or "Revised" License
173 stars 30 forks source link

create github actions that triggers based on comment '/style' in a PR #1162

Closed white238 closed 6 days ago

white238 commented 1 week ago

Thanks to the Umpire team for the basic structure of this. I tweaked it in the following ways:

Unfortunately this needs to be in the default branch, develop in our case, to enable. I tested this in a fork and should be working at this case.

Gotcha: This grabs the head commit of the PR then searches for the branch that contains that commit. If more than one branch has that commit, the GitHub Action will error with a helpful message.

white238 commented 1 week ago

/style

white238 commented 1 week ago

I'll fork the repo to try this out....

white238 commented 1 week ago

/style

white238 commented 1 week ago

This is now working. You can see me messing with it in a fork and ultimately actually working here:

https://github.com/white238/serac/pull/1

And the action triggering and finally working:

https://github.com/white238/serac/actions

This works around some pretty weird behavior from GitHub Actions that hopefully they fix eventually. I documented all the confusing parts and put some guards in place for the things I could think could go wrong, namely ending up with more than one branch for the commit.

chapman39 commented 1 week ago

Thanks for figuring this out @white238