Difference between revisions of "GITHUB REF"

From wikieduonline
Jump to navigation Jump to search
(Created page with "https://docs.github.com/en/actions/learn-github-actions/environment-variables == See also == * {{GitHub}} Category:GitHub")
 
 
(10 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
https://docs.github.com/en/actions/learn-github-actions/environment-variables
 
https://docs.github.com/en/actions/learn-github-actions/environment-variables
  
 +
The fully-formed ref of the [[branch]] or [[tag]] that triggered the workflow run. For workflows triggered by push, this is the branch or tag ref that was pushed. For workflows triggered by <code>[[pull_request]]</code>, this is the pull request merge branch. For workflows triggered by [[release]], this is the release tag created. For other triggers, this is the branch or tag ref that triggered the workflow run. This is only set if a branch or tag is available for the event type. The ref given is fully-formed, meaning that for branches the format is refs/heads/<branch_name>, for pull requests it is refs/pull/<pr_number>/merge, and for tags it is refs/tags/<tag_name>. For example, refs/heads/feature-branch-1.
 +
 +
 +
GITHUB_REF: The branch or tag ref that triggered the workflow. For example, [[refs/heads/]]your-feature-branch-1
 +
 +
Values:
 +
your_git_[[branch]]=${GITHUB_REF#refs/heads/}
 +
 +
 +
 +
== Related ==
 +
* [[Variables]]
 +
* [[GITHUB Environment variables]]
 +
* [[GITHUB_REF_NAME]]
 +
* [[on:]]
  
 
== See also ==
 
== See also ==
* {{GitHub}}
+
* {{GitHub Actions}}
  
 
[[Category:GitHub]]
 
[[Category:GitHub]]

Latest revision as of 20:29, 17 July 2023

https://docs.github.com/en/actions/learn-github-actions/environment-variables

The fully-formed ref of the branch or tag that triggered the workflow run. For workflows triggered by push, this is the branch or tag ref that was pushed. For workflows triggered by pull_request, this is the pull request merge branch. For workflows triggered by release, this is the release tag created. For other triggers, this is the branch or tag ref that triggered the workflow run. This is only set if a branch or tag is available for the event type. The ref given is fully-formed, meaning that for branches the format is refs/heads/<branch_name>, for pull requests it is refs/pull/<pr_number>/merge, and for tags it is refs/tags/<tag_name>. For example, refs/heads/feature-branch-1.


GITHUB_REF: The branch or tag ref that triggered the workflow. For example, refs/heads/your-feature-branch-1

Values:

your_git_branch=${GITHUB_REF#refs/heads/}


Related[edit]

See also[edit]

Advertising: