GitHub Actions workflow not using the latest version of a reusable workflow #198597
-
Discussion TypeQuestion Discussion ContentHi everyone, I'm using reusable workflows across multiple repositories. Recently, I updated a reusable workflow in a central repository, but some repositories still seem to execute the previous version even though they reference the same branch. I have already tried: Verifying that the workflow file was committed and pushed. However, the logs suggest that the old workflow definition is still being used. Has anyone encountered a similar issue? Is there any caching mechanism or delay in GitHub Actions that could cause this behavior? What is the recommended way to ensure repositories always use the latest version of a reusable workflow? Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
If you're referencing a reusable workflow like: jobs: GitHub resolves the workflow from the current state of main when the workflow run starts. Using branches can lead to unexpected behavior if commits are added or if you're unsure which version was used. A better approach is: jobs: This guarantees the exact workflow version. |
Beta Was this translation helpful? Give feedback.
If you're referencing a reusable workflow like:
jobs:
deploy:
uses: my-org/shared-workflows/.github/workflows/deploy.yml@main
GitHub resolves the workflow from the current state of main when the workflow run starts. Using branches can lead to unexpected behavior if commits are added or if you're unsure which version was used.
A better approach is:
jobs:
deploy:
uses: my-org/shared-workflows/.github/workflows/deploy.yml@3f2c1a7
This guarantees the exact workflow version.