Skip to content
Latchkey

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 PR
  • tag - 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 branch or tag.
  • Use it to separate release builds from CI builds.
  • Pairs with GITHUB_REF_NAME for the actual name.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →