Skip to content

Instantly share code, notes, and snippets.

@toshimaru
Last active March 30, 2025 01:54
Show Gist options
  • Save toshimaru/f14386ab69394e6ffb54aa799b9b124b to your computer and use it in GitHub Desktop.
Save toshimaru/f14386ab69394e6ffb54aa799b9b124b to your computer and use it in GitHub Desktop.

github.ref vs github.head_ref in GitHub Actions

Trigger event pull_request pull_request_target push
github.ref refs/pull/53/merge refs/heads/main refs/heads/test/pull_request_target
github.head_ref test/pull_request_target test/pull_request_target -
  • main: default branch
  • test/pull_request_target: topic branch name
  • 53: pull request number
@grimsa-aurorasolar
Copy link

FYI: there's a typo in gihub.ref - should be github.ref. Same in gihub.head_ref

@toshimaru
Copy link
Author

@grimsa-aurorasolar
thanks for reporting, fixed it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment