What does rerun do? #26804
-
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:
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? |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments
-
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. |
Beta Was this translation helpful? Give feedback.
-
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. |
Beta Was this translation helpful? Give feedback.
-
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. |
Beta Was this translation helpful? Give feedback.
-
Hi cadop, The actual code the workflows runs on depends on the trigger that you have configured. on: [ push ] will run the workflow on the code that has been pushed to a certain branch on: [ pull_request ] will run the workflow on how the code looks after it is merged. |
Beta Was this translation helpful? Give feedback.
-
Hi Koffie, thanks for trying to help so long after the post. However, I am not sure this is the full picture. I have a github action that is running on [pull_request], and the same thing as my original post is happening. Two PRs were supplied at the same time. PR1 was merged first, now PR2 is not updating the check when using “Re-run jobs”. PR1 → Changes a value in the code, that breaks a unit test. it gets Merged (with failing test). Only a single file is in the ‘Files Changed’ |
Beta Was this translation helpful? Give feedback.
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.