diff --git a/nodes/gh.go b/nodes/gh.go index 2bc2f07..46c57bb 100644 --- a/nodes/gh.go +++ b/nodes/gh.go @@ -34,13 +34,36 @@ func RemoveGhSecret(name string) { func initGhContexts() { - ghContext["github.workspace"] = os.Getenv("GITHUB_WORKSPACE") - ghContext["github.repository"] = os.Getenv("GITHUB_REPOSITORY") + // For more information on the githubs context, see: + // https://docs.github.com/en/actions/learn-github-actions/contexts + + ghContext["github.action"] = os.Getenv("GITHUB_ACTION") + // No direct mapping for 'github.action_path' + ghContext["github.actor"] = os.Getenv("GITHUB_ACTOR") + ghContext["github.actor_id"] = os.Getenv("GITHUB_ACTOR_ID") + ghContext["github.api_url"] = os.Getenv("GITHUB_API_URL") + ghContext["github.base_ref"] = os.Getenv("GITHUB_BASE_REF") + ghContext["github.env"] = os.Getenv("GITHUB_ENV") + ghContext["github.event_name"] = os.Getenv("GITHUB_EVENT_NAME") + ghContext["github.event_path"] = os.Getenv("GITHUB_EVENT_PATH") + ghContext["github.graphql_url"] = os.Getenv("GITHUB_GRAPHQL_URL") + // No direct mapping for 'github.head_ref' ghContext["github.job"] = os.Getenv("GITHUB_JOB") - ghContext["github.ref"] = os.Getenv("GITHUB_REF") + // No direct mapping for 'github.ref' + ghContext["github.ref_name"] = os.Getenv("GITHUB_REF_NAME") + // No direct mapping for 'github.ref_protected' + // No direct mapping for 'github.ref_type' + ghContext["github.repository"] = os.Getenv("GITHUB_REPOSITORY") + ghContext["github.repository_id"] = os.Getenv("GITHUB_REPOSITORY_ID") + ghContext["github.repository_owner"] = os.Getenv("GITHUB_REPOSITORY_OWNER") + ghContext["github.repository_owner_id"] = os.Getenv("GITHUB_REPOSITORY_OWNER_ID") + ghContext["github.run_attempt"] = os.Getenv("GITHUB_RUN_ATTEMPT") + ghContext["github.run_id"] = os.Getenv("GITHUB_RUN_ID") + ghContext["github.run_number"] = os.Getenv("GITHUB_RUN_NUMBER") + ghContext["github.server_url"] = os.Getenv("GITHUB_SERVER_URL") ghContext["github.sha"] = os.Getenv("GITHUB_SHA") - ghContext["github.event_name"] = os.Getenv("GITHUB_EVENT_NAME") - ghContext["github.workflow"] = os.Getenv("GITHUB_WORKFLOW") + // No direct mapping for 'github.workflow' + ghContext["github.workspace"] = os.Getenv("GITHUB_WORKSPACE") // As outlined in the documentation, secrets.GITHUB_TOKEN and github.token // are functionally equivalent. See: