go.mondoo.com/cnquery@v0.0.0-20231005093811-59568235f6ea/cli/execruntime/env_github.go (about)

     1  // Copyright (c) Mondoo, Inc.
     2  // SPDX-License-Identifier: BUSL-1.1
     3  
     4  package execruntime
     5  
     6  const GITHUB = "github"
     7  
     8  // https://docs.github.com/en/actions/learn-github-actions/environment-variables#default-environment-variables
     9  var githubEnv = &RuntimeEnv{
    10  	Id:        GITHUB,
    11  	Name:      "GitHub Actions",
    12  	Namespace: "actions.github.com",
    13  	Prefix:    "GITHUB",
    14  	Identify: []Variable{
    15  		{
    16  			Name: "GITHUB_ACTION",
    17  			Desc: "The name of the action or the id of a step",
    18  		},
    19  		{
    20  			Name: "GITHUB_ACTIONS",
    21  			Desc: "Always set to true when GitHub Actions is running the workflow",
    22  		},
    23  	},
    24  	Variables: []Variable{
    25  		{
    26  			Name: "GITHUB_ACTION",
    27  			Desc: "The name of the action",
    28  		},
    29  		{
    30  			Name: "GITHUB_ACTION_PATH",
    31  			Desc: "The path where an action is located.",
    32  		},
    33  		{
    34  			Name: "GITHUB_WORKFLOW",
    35  			Desc: "The name of the workflow",
    36  		},
    37  		{
    38  			Name: "GITHUB_ACTOR",
    39  			Desc: "The name of the person or app that initiated the workflow",
    40  		},
    41  		{
    42  			Name: "GITHUB_RUN_ID",
    43  			Desc: "A unique number for each workflow run within a repository",
    44  		},
    45  		{
    46  			Name: "GITHUB_RUN_ATTEMPT",
    47  			Desc: "A unique number for each attempt of a particular workflow run in a repository",
    48  		},
    49  		{
    50  			Name: "GITHUB_RUN_NUMBER",
    51  			Desc: "A unique number for each run of a particular workflow in a repository",
    52  		},
    53  		{
    54  			Name: "GITHUB_REPOSITORY",
    55  			Desc: "The owner and repository name",
    56  		},
    57  		{
    58  			Name: "GITHUB_REPOSITORY_OWNER",
    59  			Desc: "The repository owner's name",
    60  		},
    61  		{
    62  			Name: "GITHUB_EVENT_NAME",
    63  			Desc: "The name of the webhook event that triggered the workflow",
    64  		},
    65  		{
    66  			Name: "GITHUB_EVENT_PATH",
    67  			Desc: "The path of the file with the complete webhook event payload",
    68  		},
    69  		{
    70  			Name: "GITHUB_WORKSPACE",
    71  			Desc: "The GitHub workspace directory path",
    72  		},
    73  		{
    74  			Name: "GITHUB_SHA",
    75  			Desc: "The commit SHA that triggered the workflow",
    76  		},
    77  		{
    78  			Name: "GITHUB_REF",
    79  			Desc: "The branch or tag ref that triggered the workflow",
    80  			// for example, refs/heads/feature-branch-1
    81  		},
    82  		{
    83  			Name: "GITHUB_REF_NAME",
    84  			Desc: "The branch or tag name that triggered the workflow run",
    85  			// for example, feature-branch-1
    86  		},
    87  		{
    88  			Name: "GITHUB_HEAD_REF",
    89  			Desc: "The branch of the head repository",
    90  		},
    91  		{
    92  			Name: "GITHUB_BASE_REF",
    93  			Desc: "The branch of the base repository",
    94  		},
    95  		{
    96  			Name: "GITHUB_REF_TYPE",
    97  			Desc: "The type of ref that triggered the workflow run: `branch` or `tag`",
    98  		},
    99  		{
   100  			Name: "GITHUB_JOB",
   101  			Desc: "The job_id of the current job",
   102  		},
   103  		{
   104  			Name: "GITHUB_SERVER_URL",
   105  			Desc: "The URL of the GitHub server",
   106  		},
   107  		{
   108  			Name: "GITHUB_WORKFLOW",
   109  			Desc: "The name of the workflow",
   110  		},
   111  		{
   112  			Name: "GITHUB_REF_PROTECTED",
   113  			Desc: "true if branch protections are configured for the ref",
   114  		},
   115  		{
   116  			Name: "RUNNER_ARCH",
   117  			Desc: "The architecture of the runner executing the job",
   118  		},
   119  		{
   120  			Name: "RUNNER_NAME",
   121  			Desc: "The name of the runner executing the job",
   122  		},
   123  		{
   124  			Name: "RUNNER_OS",
   125  			Desc: "The operating system of the runner executing the job",
   126  		},
   127  	},
   128  }