GitHub's documentation for developers of GitHub Actions recommend that in addition to specific tagged releases with SemVer release numbers that a major release tag is maintained and moved to point to the most recent specific version. For example, let's say that you just release v3.1.2 (with corresponding tag). The recommendation is to then move a v3 tag to point to that new version. This gives users of the action the option to use specific release version, such as v3.1.2, or to just use the major release number, v3, which enables them to automatically gain the benefit of any bug fixes without updating their workflows.
When you create a release, this workflow runs. It assumes that the release tag is of the form, vX.Y.Z (where X, Y, and Z are the major, minor, and patch numbers of a SemVer version). From this, it extracts the major version forming a string of the form vX. It then adds (if it doesn't exist) or moves (if it does exist) the tag with major version only to the new released version. For example, if the new release has a tag of v3.1.2, it will move the v3 tag to also point to the v3.1.2 release. Or for example, let's say you just released a new major version, with tag v4.0.0, this workflow will add a new tag v4 that also points to v4.0.0.
To use this workflow, drop the workflow file into the .github/workflows
directory. And then edit your name and username where indicated.