kaskadi / template-kaskadi-element

a template for building kaskadi's custom elements
MIT License
0 stars 0 forks source link

Init action does not run on create #17

Closed Holger-Will closed 4 years ago

Holger-Will commented 4 years ago

when I just created the kaskadi-icon repo from this template, the init.yml action did not run. to force run it I had to create a new branch. We should at least document that this can happen and how to fix it when it happens...

as it did run previously I think github changed the behavior for the create event...

Holger-Will commented 4 years ago

ok, so my fix with creating a new branch did not work either because we are trying and only run init on master branch :-(

alexlemaire commented 4 years ago

Will have a look at that again :)

alexlemaire commented 4 years ago

Debugging report

  1. Created a new repo called test-element. init action ran for me BUT there was an error where the CLI wasn't found so it didn't got renamed.
  2. Worked on a fix, deleted the repo and created another one with the same name => the init action did not run.
  3. Found a better fix (the CLI call was mapped to the source file name but since it got renamed it broke the action -> it's mapped to the bin symlink instead now). I deleted the repo and created it again => init ran successfully and renamed everything

For some reason it seems that init doesn't run sometimes but I'm not sure why... We should watch this closely and see if it happens again

alexlemaire commented 4 years ago

I'm adding the help wanted label just to highlight this and remind us to check if init runs when we try to create new elements

alexlemaire commented 4 years ago

I did multiple extra test (creating test-element repetitively) and for now I did not encounter this bug again...

alexlemaire commented 4 years ago

I maybe have an hint on the triggering event for that bug.

It happened to me again recently when I did the following:

This seemed to prevent the init action from executing as it didn't get started. But when I deleted the repository and recreated it without doing anything on it then init ran properly.

So I am suspecting that taking any kind of actions on the repository upon creation is somehow preventing the initial actions to run. Temporary fix (let's see if it works): when creating a new repo based off of template, do not do anything for like 2 mins or so with this repo to let the time for GitHub Actions to trigger properly. If this is the confirmed reason for the bug it may be worth bring that up to the GitHub team as this doesn't seem like a really robust behavior to me...

alexlemaire commented 4 years ago

Issue fixed. Two things:

  1. I swapped the trigger from create to push
  2. I applied a conditional at job level to check whether the repository running the job is the template one or not. If it is, then we skip init. If not, then we run init

This makes the init workflow run faster (starts almost instantly) and it doesn't skip so far (I tried around 10 times or so).

Closing for now.