workflow_usage
Creates, updates, deletes, gets or lists a workflow_usage resource.
Overview
| Name | workflow_usage |
| Type | Resource |
| Id | github.actions.workflow_usage |
Fields
The following fields are returned by SELECT queries:
- get_workflow_usage
Response
| Name | Datatype | Description |
|---|---|---|
MACOS | object | |
UBUNTU | object | |
WINDOWS | object |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_workflow_usage | select | owner, repo, workflow_id | > [!WARNING] > This endpoint is in the process of closing down. Refer to "Actions Get workflow usage and Get workflow run usage endpoints closing down" for more information. Gets the number of billable minutes used by a specific workflow during the current billing cycle. Billable minutes only apply to workflows in private repositories that use GitHub-hosted runners. Usage is listed for each GitHub-hosted runner operating system in milliseconds. Any job re-runs are also included in the usage. The usage does not include the multiplier for macOS and Windows runners and is not rounded up to the nearest whole minute. For more information, see "Managing billing for GitHub Actions". You can replace workflow_id with the workflow file name. For example, you could use main.yaml.Anyone with read access to the repository can use this endpoint. OAuth app tokens and personal access tokens (classic) need the repo scope to use this endpoint with a private repository. |
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. |
repo | string | The name of the repository without the .git extension. The name is not case sensitive. |
workflow_id | | The ID of the workflow. You can also pass the workflow file name as a string. |
SELECT examples
- get_workflow_usage
> [!WARNING]
> This endpoint is in the process of closing down. Refer to "Actions Get workflow usage and Get workflow run usage endpoints closing down" for more information.
Gets the number of billable minutes used by a specific workflow during the current billing cycle. Billable minutes only apply to workflows in private repositories that use GitHub-hosted runners. Usage is listed for each GitHub-hosted runner operating system in milliseconds. Any job re-runs are also included in the usage. The usage does not include the multiplier for macOS and Windows runners and is not rounded up to the nearest whole minute. For more information, see "Managing billing for GitHub Actions".
You can replace workflow_id with the workflow file name. For example, you could use main.yaml.
Anyone with read access to the repository can use this endpoint.
OAuth app tokens and personal access tokens (classic) need the repo scope to use this endpoint with a private repository.
SELECT
MACOS,
UBUNTU,
WINDOWS
FROM github.actions.workflow_usage
WHERE owner = '{{ owner }}' -- required
AND repo = '{{ repo }}' -- required
AND workflow_id = '{{ workflow_id }}' -- required
;