Code of Conduct
What article on docs.github.com is affected?
https://docs.github.com/en/actions/learn-github-actions/environment-variables#default-environment-variables
What part(s) of the article would you like to see updated?
GITHUB_REF and GITHUB_REF_NAME show example values of refs/heads/feature-branch-1 and feature-branch-1 respectively. However this is inconsistent with the values populated in the case of a PR-triggered workflow.
Given the description and example, one would expect to see the branch that triggered the workflow when running a PR-triggered workflow. Instead these variables are populated by values like refs/pull/26/merge and 26/merge respectively. The variable that contains the desired data in this case is actually GITHUB_HEAD_REF.
The documentation should be updated to more accurately describe the content of GitHub Actions predefined variables.
Additional information
No response
Code of Conduct
What article on docs.github.com is affected?
https://docs.github.com/en/actions/learn-github-actions/environment-variables#default-environment-variables
What part(s) of the article would you like to see updated?
GITHUB_REFandGITHUB_REF_NAMEshow example values ofrefs/heads/feature-branch-1andfeature-branch-1respectively. However this is inconsistent with the values populated in the case of a PR-triggered workflow.Given the description and example, one would expect to see the branch that triggered the workflow when running a PR-triggered workflow. Instead these variables are populated by values like
refs/pull/26/mergeand26/mergerespectively. The variable that contains the desired data in this case is actuallyGITHUB_HEAD_REF.The documentation should be updated to more accurately describe the content of GitHub Actions predefined variables.
Additional information
No response