Skip to content

Class: GhaWorkflow

A workflow file in a repository’s .github/workflows directory: the events that run it, the access its GITHUB_TOKEN gets, and its jobs.

URI: gha:Workflow

 classDiagram
    class GhaWorkflow
    click GhaWorkflow href "../GhaWorkflow/"
      GhaWorkflow <|-- GhaReusableWorkflow
        click GhaReusableWorkflow href "../GhaReusableWorkflow/"
      
      GhaWorkflow : jobs
        
          
    
        
        
        GhaWorkflow --> "1..*" GhaWorkflowJob : jobs
        click GhaWorkflowJob href "../GhaWorkflowJob/"
    

        
      GhaWorkflow : permissions
        
      GhaWorkflow : triggers
        
      GhaWorkflow : workflow_path
        
      GhaWorkflow : workflow_repository
        
      GhaWorkflow : workflow_uri
        
      
Property Value
Class URI gha:Workflow
Name Cardinality and Range Description Inheritance
triggers 1..*
String
The names of the events under the file’s on key, such as push, `pull_requ… direct
workflow_uri 1
Uri
The file’s address on its forge without a ref: `https://github direct
workflow_path 1
String
The file’s path from the repository root, as GitHub’s build type writes workf… direct
workflow_repository 0..1
Uri
The repository that holds the file, as GitHub’s build type writes workflow direct
permissions *
GhaPermission
The access the file’s top-level permissions key gives every job’s GITHUB_TO… direct
jobs 1..*
GhaWorkflowJob
The jobs under the file’s jobs key direct
used by used in type used
GhaDocument workflows range GhaWorkflow
GhaRequiredStatusCheck emitted_by range GhaWorkflow
  • SPDX 3.0.1’s Build records one run of a build, such as a run of this workflow, so it is a related term and not a close one.
  • The ref a run checks the file out at belongs to the run, and GitHub’s build type records it in provenance as workflow.ref; it is not a fact of the file, so it is not modelled here.
Mapping Type Mapped Value
self gha:Workflow
native gha:GhaWorkflow
related spdx_build:Build
close cdx:workflow
name: GhaWorkflow
description: 'A workflow file in a repository''s `.github/workflows` directory: the
events that run it, the access its GITHUB_TOKEN gets, and its jobs.'
comments:
- SPDX 3.0.1's Build records one run of a build, such as a run of this workflow, so
it is a related term and not a close one.
- The ref a run checks the file out at belongs to the run, and GitHub's build type
records it in provenance as workflow.ref; it is not a fact of the file, so it is
not modelled here.
from_schema: https://w3id.org/lmodel/github-actions
see_also:
- https://docs.github.com/en/actions/reference/workflows-and-actions/workflow-syntax
close_mappings:
- cdx:workflow
related_mappings:
- spdx_build:Build
slots:
- triggers
slot_usage:
triggers:
name: triggers
required: true
attributes:
workflow_uri:
name: workflow_uri
description: 'The file''s address on its forge without a ref: `https://github.com/<owner>/<repo>/.github/workflows/<file>`.'
comments:
- GitHub's build type forms a reusable workflow's builder.id from this address,
followed by `@` and the ref.
from_schema: https://w3id.org/lmodel/github-actions/github_actions_workflow
rank: 1000
identifier: true
domain_of:
- GhaWorkflow
range: uri
workflow_path:
name: workflow_path
description: The file's path from the repository root, as GitHub's build type
writes workflow.path. GitHub reads no subdirectory of `.github/workflows`.
from_schema: https://w3id.org/lmodel/github-actions/github_actions_workflow
see_also:
- https://actions.github.io/buildtypes/workflow/v1
rank: 1000
domain_of:
- GhaWorkflow
required: true
pattern: ^\.github/workflows/[^/]+\.ya?ml$
workflow_repository:
name: workflow_repository
description: 'The repository that holds the file, as GitHub''s build type writes
workflow.repository: an HTTPS address without `.git`.'
from_schema: https://w3id.org/lmodel/github-actions/github_actions_workflow
see_also:
- https://actions.github.io/buildtypes/workflow/v1
rank: 1000
domain_of:
- GhaWorkflow
range: uri
pattern: ^https://[^/]+/[^/]+/[^/]+$
permissions:
name: permissions
description: The access the file's top-level `permissions` key gives every job's
GITHUB_TOKEN. Absent when the file sets none, so the repository's or organization's
default applies; a scope the map leaves out gets no access.
from_schema: https://w3id.org/lmodel/github-actions/github_actions_workflow
rank: 1000
domain_of:
- GhaWorkflow
range: gha_permission
multivalued: true
jobs:
name: jobs
description: The jobs under the file's `jobs` key.
from_schema: https://w3id.org/lmodel/github-actions/github_actions_workflow
rank: 1000
domain_of:
- GhaWorkflow
range: GhaWorkflowJob
required: true
multivalued: true
inlined: true
inlined_as_list: true
class_uri: gha:Workflow
name: GhaWorkflow
description: 'A workflow file in a repository''s `.github/workflows` directory: the
events that run it, the access its GITHUB_TOKEN gets, and its jobs.'
comments:
- SPDX 3.0.1's Build records one run of a build, such as a run of this workflow, so
it is a related term and not a close one.
- The ref a run checks the file out at belongs to the run, and GitHub's build type
records it in provenance as workflow.ref; it is not a fact of the file, so it is
not modelled here.
from_schema: https://w3id.org/lmodel/github-actions
see_also:
- https://docs.github.com/en/actions/reference/workflows-and-actions/workflow-syntax
close_mappings:
- cdx:workflow
related_mappings:
- spdx_build:Build
slot_usage:
triggers:
name: triggers
required: true
attributes:
workflow_uri:
name: workflow_uri
description: 'The file''s address on its forge without a ref: `https://github.com/<owner>/<repo>/.github/workflows/<file>`.'
comments:
- GitHub's build type forms a reusable workflow's builder.id from this address,
followed by `@` and the ref.
from_schema: https://w3id.org/lmodel/github-actions/github_actions_workflow
rank: 1000
identifier: true
owner: GhaWorkflow
domain_of:
- GhaWorkflow
range: uri
required: true
workflow_path:
name: workflow_path
description: The file's path from the repository root, as GitHub's build type
writes workflow.path. GitHub reads no subdirectory of `.github/workflows`.
from_schema: https://w3id.org/lmodel/github-actions/github_actions_workflow
see_also:
- https://actions.github.io/buildtypes/workflow/v1
rank: 1000
owner: GhaWorkflow
domain_of:
- GhaWorkflow
range: string
required: true
pattern: ^\.github/workflows/[^/]+\.ya?ml$
workflow_repository:
name: workflow_repository
description: 'The repository that holds the file, as GitHub''s build type writes
workflow.repository: an HTTPS address without `.git`.'
from_schema: https://w3id.org/lmodel/github-actions/github_actions_workflow
see_also:
- https://actions.github.io/buildtypes/workflow/v1
rank: 1000
owner: GhaWorkflow
domain_of:
- GhaWorkflow
range: uri
pattern: ^https://[^/]+/[^/]+/[^/]+$
permissions:
name: permissions
description: The access the file's top-level `permissions` key gives every job's
GITHUB_TOKEN. Absent when the file sets none, so the repository's or organization's
default applies; a scope the map leaves out gets no access.
from_schema: https://w3id.org/lmodel/github-actions/github_actions_workflow
rank: 1000
owner: GhaWorkflow
domain_of:
- GhaWorkflow
range: gha_permission
multivalued: true
jobs:
name: jobs
description: The jobs under the file's `jobs` key.
from_schema: https://w3id.org/lmodel/github-actions/github_actions_workflow
rank: 1000
owner: GhaWorkflow
domain_of:
- GhaWorkflow
range: GhaWorkflowJob
required: true
multivalued: true
inlined: true
inlined_as_list: true
triggers:
name: triggers
description: The names of the events under the file's `on` key, such as `push`,
`pull_request`, `schedule` or `workflow_call`.
comments:
- A slot rather than an attribute because GhaReusableWorkflow refines it; a pattern
rather than an enumeration, because GitHub adds events.
from_schema: https://w3id.org/lmodel/github-actions
see_also:
- https://docs.github.com/en/actions/reference/workflows-and-actions/events-that-trigger-workflows
related_mappings:
- cdx:trigger
rank: 1000
slot_uri: gha:triggers
owner: GhaWorkflow
domain_of:
- GhaWorkflow
range: string
required: true
multivalued: true
pattern: ^[a-z_]+$
class_uri: gha:Workflow