TIL: GitHub Actions reruns = unchanged child workflows
Using Simon Willison’s what to blog about as inspiration, I’m going to try writing up some short TILs. Maybe if I can stick with it I’ll also copy his subdomain idea to keep them separate from “real” posts. Who knows.
I’m mainly going to try to spend very little time copy editing them so I can get better at writing clearly in fewer tries.
TIL: When rerunning a Github Actions workflow that makes use of an upstream one, it does not re-pull that referenced workflow
- A colleague had written a reusable workflow that I was attempting to make use of in my git repo.
- The reusable workflow wasn’t quite right for my needs, so I opened a branch on their repo and made changes as I went:
kb/f/adjust-workflow - I attempted to test my adjustments to
kb/f/adjust-workflowby rerunning the CI job in my repo (that makes makes use of their repo), and was deeply confused when my changes repeatedly failed to show up - I had (incorrectly) understood that ‘rerun this workflow’ retriggers the workflow from an unchanged starting state/input, but otherwise reevaluates all steps
- ie in this case I thought that my job would reevaluate the
uses:statement and pull the latest code from the@kb/f/adjust-workflowreferencejobs: my-job: uses: MyOrg/upstream-reusable/.github/workflows/echo-stuff.yml@kb/f/adjust-workflow
- ie in this case I thought that my job would reevaluate the
- It actually (somewhere) caches the versions of workflows it references and reuses them too
- If you need to test changes to your reusable workflow, you have to retrigger the consuming workflow “properly”, not rerun an old one