What does rerun do?

I am still learning the yml format and how things work, so maybe this is not the most common of problems, but I am pretty confused on the wording of ‘rerun’.

So essentially what happened was:

  • I have some folder to ignore for pytest. Someone made a PR (1) that changed that folders name but without any other things. For some reason, none of the github actions ran (I am guessing they first set the PR to a branch that doesnt have actions, then changed the branch to merge into that does have actions, and then it didn’t run)
  • I merged the PR 1
  • The next PR (2) was for something unrelated, but now the github action fails because the folder that was being ignored was renamed. it does not change the yml file
  • I updated the yml file to fix the name
  • I went back to the PR 2 and clicked rerun, but it fails again, because it is using the old yml file

So what is rerun supposed to do? Just rerunning the same thing that will fail will keep failing if it doesn’t include any changes of the repo, right? Or am I not using it correctly?

It will depend what code is checked out by the workflow. In the scenario you described the second PR would need to be rebased on the updated default branch, and force pushed, so that the proper workflow runs.

So workflows run on the branch they come from, but not what the branch will look like if it is merged? That seems so strange, especially if using features like unittests to make sure a change doesn’t break anything.

What runs (in most cases…there are exceptions) is the workflow in the destination repo (for security reasons) what it runs against depends on what is checked out by the workflow.

1 Like