Github Actions version


Can we use the latest version of any Github Actions package by default without specifying the version of the package. Currently, if there is any version change for the action script, we need to update the workflow definition file.



    runs-on: ubuntu-latest

    - uses: actions/checkout@v2

In above example, can we specify just actions/checkout without the version prefix (@v2), does it automatically fetch the latest version or is something like this even possible ?


You can use any Git ref after the @, including a branch name like main. However, please heed the warning from the documentation:

Using the default branch of an action may be convenient, but if someone releases a new major version with a breaking change, your workflow could break.

And you’d also be hit by any bug that might end up pushed to the default branch, but gets fixed before release.