Skip to main content

ref

Creates, updates, deletes, gets or lists a ref resource.

Overview

Nameref
TypeResource
Idgithub.git.ref

Fields

The following fields are returned by SELECT queries:

Response

NameDatatypeDescription
node_idstring
objectobject
refstring
urlstring (uri)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_refselectowner, repo, refReturns a single reference from your Git database. The :ref in the URL must be formatted as heads/<branch name> for branches and tags/<tag name> for tags. If the :ref doesn't match an existing ref, a 404 is returned.

> [!NOTE]
> You need to explicitly request a pull request to trigger a test merge commit, which checks the mergeability of pull requests. For more information, see "Checking mergeability of pull requests".

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
ownerstringThe account owner of the repository. The name is not case sensitive.
refstringThe Git reference. For more information, see "Git References" in the Git documentation. (example: heads/feature-a)
repostringThe name of the repository without the .git extension. The name is not case sensitive.

SELECT examples

Returns a single reference from your Git database. The :ref in the URL must be formatted as heads/<branch name> for branches and tags/<tag name> for tags. If the :ref doesn't match an existing ref, a 404 is returned.

> [!NOTE]
> You need to explicitly request a pull request to trigger a test merge commit, which checks the mergeability of pull requests. For more information, see "Checking mergeability of pull requests".

SELECT
node_id,
object,
ref,
url
FROM github.git.ref
WHERE owner = '{{ owner }}' -- required
AND repo = '{{ repo }}' -- required
AND ref = '{{ ref }}' -- required
;