What Is GITHUB_REF_TYPE?
GITHUB_REF_TYPE is either branch or tag, depending on what triggered the run.
GITHUB_REF_TYPE lets a single workflow behave differently for tag pushes (releases) versus branch pushes (CI), without parsing the full ref.
Values
branch- a branch push or PRtag- a tag push (often a release)
Example
Run a release job only on tags.
yaml
if: ${{ github.ref_type == 'tag' }}Key takeaways
- GITHUB_REF_TYPE is
branchortag. - Use it to separate release builds from CI builds.
- Pairs with GITHUB_REF_NAME for the actual name.