ref
Creates, updates, deletes, gets or lists a ref resource.
Overview
| Name | ref |
| Type | Resource |
| Id | github.git.ref |
Fields
The following fields are returned by SELECT queries:
- get_ref
Response
| Name | Datatype | Description |
|---|---|---|
node_id | string | |
object | object | |
ref | string | |
url | string (uri) |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_ref | select | owner, repo, ref | 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". |
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.
| Name | Datatype | Description |
|---|---|---|
owner | string | The account owner of the repository. The name is not case sensitive. |
ref | string | The Git reference. For more information, see "Git References" in the Git documentation. (example: heads/feature-a) |
repo | string | The name of the repository without the .git extension. The name is not case sensitive. |
SELECT examples
- get_ref
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
;