github.workflows Submodule
Structs
AppPermissions
The permissions available to a GitHub App.
Typically a token for a GitHub App has all the available scopes/permissions available to the app itself; however, a more limited set of permissions can be specified. When permissions are provided, only the specified permissions are granted to the token.
https://github.com/actions/create-github-app-token/blob/main/action.yml#L28
Initializer
import { github } from 'projen'
const appPermissions: github.workflows.AppPermissions = { ... }
Properties
| Name | Type | Description |
|---|---|---|
| projen.github.workflows.AppPermission | No description. |
| projen.github.workflows.AppPermission | No description. |
| projen.github.workflows.AppPermission | No description. |
| projen.github.workflows.AppPermission | No description. |
| projen.github.workflows.AppPermission | No description. |
| projen.github.workflows.AppPermission | No description. |
| projen.github.workflows.AppPermission | No description. |
| projen.github.workflows.AppPermission | No description. |
| projen.github.workflows.AppPermission | No description. |
| projen.github.workflows.AppPermission | No description. |
| projen.github.workflows.AppPermission | No description. |
| projen.github.workflows.AppPermission | No description. |
| projen.github.workflows.AppPermission | No description. |
| projen.github.workflows.AppPermission | No description. |
| projen.github.workflows.AppPermission | No description. |
| projen.github.workflows.AppPermission | No description. |
| projen.github.workflows.AppPermission | No description. |
| projen.github.workflows.AppPermission | No description. |
| projen.github.workflows.AppPermission | No description. |
| projen.github.workflows.AppPermission | No description. |
| projen.github.workflows.AppPermission | No description. |
| projen.github.workflows.AppPermission | No description. |
| projen.github.workflows.AppPermission | No description. |
| projen.github.workflows.AppPermission | No description. |
| projen.github.workflows.AppPermission | No description. |
| projen.github.workflows.AppPermission | No description. |
| projen.github.workflows.AppPermission | No description. |
| projen.github.workflows.AppPermission | No description. |
| projen.github.workflows.AppPermission | No description. |
| projen.github.workflows.AppPermission | No description. |
| projen.github.workflows.AppPermission | No description. |
| projen.github.workflows.AppPermission | No description. |
| projen.github.workflows.AppPermission | No description. |
| projen.github.workflows.AppPermission | No description. |
| projen.github.workflows.AppPermission | No description. |
| projen.github.workflows.AppPermission | No description. |
| projen.github.workflows.AppPermission | No description. |
| projen.github.workflows.AppPermission | No description. |
| projen.github.workflows.AppPermission | No description. |
| projen.github.workflows.AppPermission | No description. |
| projen.github.workflows.AppPermission | No description. |
| projen.github.workflows.AppPermission | No description. |
| projen.github.workflows.AppPermission | No description. |
| projen.github.workflows.AppPermission | No description. |
| projen.github.workflows.AppPermission | No description. |
| projen.github.workflows.AppPermission | No description. |
| projen.github.workflows.AppPermission | No description. |
| projen.github.workflows.AppPermission | No description. |
| projen.github.workflows.AppPermission | No description. |
| projen.github.workflows.AppPermission | No description. |
actionsOptional
public readonly actions: AppPermission;
- Type: projen.github.workflows.AppPermission
administrationOptional
public readonly administration: AppPermission;
- Type: projen.github.workflows.AppPermission
attestationsOptional
public readonly attestations: AppPermission;
- Type: projen.github.workflows.AppPermission
checksOptional
public readonly checks: AppPermission;
- Type: projen.github.workflows.AppPermission
codespacesOptional
public readonly codespaces: AppPermission;
- Type: projen.github.workflows.AppPermission
contentsOptional
public readonly contents: AppPermission;
- Type: projen.github.workflows.AppPermission
dependabotSecretsOptional
public readonly dependabotSecrets: AppPermission;
- Type: projen.github.workflows.AppPermission
deploymentsOptional
public readonly deployments: AppPermission;
- Type: projen.github.workflows.AppPermission
emailAddressesOptional
public readonly emailAddresses: AppPermission;
- Type: projen.github.workflows.AppPermission
environmentsOptional
public readonly environments: AppPermission;
- Type: projen.github.workflows.AppPermission
followersOptional
public readonly followers: AppPermission;
- Type: projen.github.workflows.AppPermission
gitSshKeysOptional
public readonly gitSshKeys: AppPermission;
- Type: projen.github.workflows.AppPermission
gpgKeysOptional
public readonly gpgKeys: AppPermission;
- Type: projen.github.workflows.AppPermission
interactionLimitsOptional
public readonly interactionLimits: AppPermission;
- Type: projen.github.workflows.AppPermission
issuesOptional
public readonly issues: AppPermission;
- Type: projen.github.workflows.AppPermission
membersOptional
public readonly members: AppPermission;
- Type: projen.github.workflows.AppPermission
metadataOptional
public readonly metadata: AppPermission;
- Type: projen.github.workflows.AppPermission
organizationAdministrationOptional
public readonly organizationAdministration: AppPermission;
- Type: projen.github.workflows.AppPermission
organizationAnnouncementBannersOptional
public readonly organizationAnnouncementBanners: AppPermission;
- Type: projen.github.workflows.AppPermission
organizationCopilotSeatManagementOptional
public readonly organizationCopilotSeatManagement: AppPermission;
- Type: projen.github.workflows.AppPermission
organizationCustomOrgRolesOptional
public readonly organizationCustomOrgRoles: AppPermission;
- Type: projen.github.workflows.AppPermission
organizationCustomPropertiesOptional
public readonly organizationCustomProperties: AppPermission;
- Type: projen.github.workflows.AppPermission
organizationCustomRolesOptional
public readonly organizationCustomRoles: AppPermission;
- Type: projen.github.workflows.AppPermission
organizationEventsOptional
public readonly organizationEvents: AppPermission;
- Type: projen.github.workflows.AppPermission
organizationHooksOptional
public readonly organizationHooks: AppPermission;
- Type: projen.github.workflows.AppPermission
organizationPackagesOptional
public readonly organizationPackages: AppPermission;
- Type: projen.github.workflows.AppPermission
organizationPersonalAccessTokenRequestsOptional
public readonly organizationPersonalAccessTokenRequests: AppPermission;
- Type: projen.github.workflows.AppPermission
organizationPersonalAccessTokensOptional
public readonly organizationPersonalAccessTokens: AppPermission;
- Type: projen.github.workflows.AppPermission
organizationPlanOptional
public readonly organizationPlan: AppPermission;
- Type: projen.github.workflows.AppPermission
organizationProjectsOptional
public readonly organizationProjects: AppPermission;
- Type: projen.github.workflows.AppPermission
organizationSecretsOptional
public readonly organizationSecrets: AppPermission;
- Type: projen.github.workflows.AppPermission
organizationSelfHostedRunnersOptional
public readonly organizationSelfHostedRunners: AppPermission;
- Type: projen.github.workflows.AppPermission
orgnaizationUserBlockingOptional
public readonly orgnaizationUserBlocking: AppPermission;
- Type: projen.github.workflows.AppPermission
packagesOptional
public readonly packages: AppPermission;
- Type: projen.github.workflows.AppPermission
pagesOptional
public readonly pages: AppPermission;
- Type: projen.github.workflows.AppPermission
profileOptional
public readonly profile: AppPermission;
- Type: projen.github.workflows.AppPermission
pullRequestsOptional
public readonly pullRequests: AppPermission;
- Type: projen.github.workflows.AppPermission
repositoryAnnouncementBannersOptional
repositoryAnnouncementBanners- Deprecated: removed by GitHub
public readonly repositoryAnnouncementBanners: AppPermission;
- Type: projen.github.workflows.AppPermission
repositoryCustomPropertiesOptional
public readonly repositoryCustomProperties: AppPermission;
- Type: projen.github.workflows.AppPermission
repositoryHooksOptional
public readonly repositoryHooks: AppPermission;
- Type: projen.github.workflows.AppPermission
repositoryProjectsOptional
public readonly repositoryProjects: AppPermission;
- Type: projen.github.workflows.AppPermission
secretsOptional
public readonly secrets: AppPermission;
- Type: projen.github.workflows.AppPermission
secretScanningAlertsOptional
public readonly secretScanningAlerts: AppPermission;
- Type: projen.github.workflows.AppPermission
securityEventsOptional
public readonly securityEvents: AppPermission;
- Type: projen.github.workflows.AppPermission
singleFileOptional
public readonly singleFile: AppPermission;
- Type: projen.github.workflows.AppPermission
starringOptional
public readonly starring: AppPermission;
- Type: projen.github.workflows.AppPermission
statusesOptional
public readonly statuses: AppPermission;
- Type: projen.github.workflows.AppPermission
teamDiscussionsOptional
public readonly teamDiscussions: AppPermission;
- Type: projen.github.workflows.AppPermission
vulnerabilityAlertsOptional
public readonly vulnerabilityAlerts: AppPermission;
- Type: projen.github.workflows.AppPermission
workflowsOptional
public readonly workflows: AppPermission;
- Type: projen.github.workflows.AppPermission
BranchProtectionRuleOptions
Branch Protection Rule options.
Initializer
import { github } from 'projen'
const branchProtectionRuleOptions: github.workflows.BranchProtectionRuleOptions = { ... }
Properties
| Name | Type | Description |
|---|---|---|
| string[] | Which activity types to trigger on. |
typesOptional
public readonly types: string[];
- Type: string[]
Which activity types to trigger on.
CheckRunOptions
Check run options.
Initializer
import { github } from 'projen'
const checkRunOptions: github.workflows.CheckRunOptions = { ... }
Properties
| Name | Type | Description |
|---|---|---|
| string[] | Which activity types to trigger on. |
typesOptional
public readonly types: string[];
- Type: string[]
Which activity types to trigger on.
CheckSuiteOptions
Check suite options.
Initializer
import { github } from 'projen'
const checkSuiteOptions: github.workflows.CheckSuiteOptions = { ... }
Properties
| Name | Type | Description |
|---|---|---|
| string[] | Which activity types to trigger on. |
typesOptional
public readonly types: string[];
- Type: string[]
Which activity types to trigger on.
CommonJobDefinition
Initializer
import { github } from 'projen'
const commonJobDefinition: github.workflows.CommonJobDefinition = { ... }
Properties
| Name | Type | Description |
|---|---|---|
| projen.github.workflows.JobPermissions | You can modify the default permissions granted to the GITHUB_TOKEN, adding or removing access as required, so that you only allow the minimum required access. |
| any | Concurrency ensures that only a single job or workflow using the same concurrency group will run at a time. |
| string | You can use the if conditional to prevent a job from running unless a condition is met. |
| string | The name of the job displayed on GitHub. |
| string[] | Identifies any jobs that must complete successfully before this job will run. |
| projen.github.workflows.JobStrategy | A strategy creates a build matrix for your jobs. |
permissionsRequired
public readonly permissions: JobPermissions;
- Type: projen.github.workflows.JobPermissions
You can modify the default permissions granted to the GITHUB_TOKEN, adding or removing access as required, so that you only allow the minimum required access.
Use { contents: READ } if your job only needs to clone code.
This is intentionally a required field since it is required in order to allow workflows to run in GitHub repositories with restricted default access.
concurrencyOptional
public readonly concurrency: any;
- Type: any
Concurrency ensures that only a single job or workflow using the same concurrency group will run at a time.
A concurrency group can be any string or expression. The expression can use any context except for the secrets context.
ifOptional
public readonly if: string;
- Type: string
You can use the if conditional to prevent a job from running unless a condition is met.
You can use any supported context and expression to create a conditional.
nameOptional
public readonly name: string;
- Type: string
The name of the job displayed on GitHub.
needsOptional
public readonly needs: string[];
- Type: string[]
Identifies any jobs that must complete successfully before this job will run.
It can be a string or array of strings. If a job fails, all jobs that need it are skipped unless the jobs use a conditional expression that causes the job to continue.
strategyOptional
public readonly strategy: JobStrategy;
- Type: projen.github.workflows.JobStrategy
A strategy creates a build matrix for your jobs.
You can define different variations to run each job in.
ContainerCredentials
Credentials to use to authenticate to Docker registries.
Initializer
import { github } from 'projen'
const containerCredentials: github.workflows.ContainerCredentials = { ... }
Properties
| Name | Type | Description |
|---|---|---|
| string | The password. |
| string | The username. |
passwordRequired
public readonly password: string;
- Type: string
The password.
usernameRequired
public readonly username: string;
- Type: string
The username.
ContainerOptions
Options pertaining to container environments.
Initializer
import { github } from 'projen'
const containerOptions: github.workflows.ContainerOptions = { ... }
Properties
| Name | Type | Description |
|---|---|---|
| string | The Docker image to use as the container to run the action. |
| projen.github.workflows.ContainerCredentials | f the image's container registry requires authentication to pull the image, you can use credentials to set a map of the username and password. |
| {[ key: string ]: string} | Sets a map of environment variables in the container. |
| string[] | Additional Docker container resource options. |
| number[] | Sets an array of ports to expose on the container. |
| string[] | Sets an array of volumes for the container to use. |
imageRequired
public readonly image: string;
- Type: string
The Docker image to use as the container to run the action.
The value can be the Docker Hub image name or a registry name.
credentialsOptional
public readonly credentials: ContainerCredentials;
- Type: projen.github.workflows.ContainerCredentials
f the image's container registry requires authentication to pull the image, you can use credentials to set a map of the username and password.
The credentials are the same values that you would provide to the docker login command.
envOptional
public readonly env: {[ key: string ]: string};
- Type: {[ key: string ]: string}
Sets a map of environment variables in the container.
optionsOptional
public readonly options: string[];
- Type: string[]
Additional Docker container resource options.
https://docs.docker.com/engine/reference/commandline/create/#options
portsOptional
public readonly ports: number[];
- Type: number[]
Sets an array of ports to expose on the container.
volumesOptional
public readonly volumes: string[];
- Type: string[]
Sets an array of volumes for the container to use.
You can use volumes to share data between services or other steps in a job. You can specify named Docker volumes, anonymous Docker volumes, or bind mounts on the host.
To specify a volume, you specify the source and destination path:
<source>:<destinationPath>.
CreateOptions
The Create event accepts no options.
Initializer
import { github } from 'projen'
const createOptions: github.workflows.CreateOptions = { ... }
CronScheduleOptions
CRON schedule options.
Initializer
import { github } from 'projen'
const cronScheduleOptions: github.workflows.CronScheduleOptions = { ... }
Properties
| Name | Type | Description |
|---|---|---|
| string | No description. |
cronRequired
public readonly cron: string;
- Type: string
https://pubs.opengroup.org/onlinepubs/9699919799/utilities/crontab.html#tag_20_25_07
DeleteOptions
The Delete event accepts no options.
Initializer
import { github } from 'projen'
const deleteOptions: github.workflows.DeleteOptions = { ... }
DeploymentOptions
The Deployment event accepts no options.
Initializer
import { github } from 'projen'
const deploymentOptions: github.workflows.DeploymentOptions = { ... }
DeploymentStatusOptions
The Deployment status event accepts no options.
Initializer
import { github } from 'projen'
const deploymentStatusOptions: github.workflows.DeploymentStatusOptions = { ... }
DiscussionCommentOptions
Discussion comment options.
Initializer
import { github } from 'projen'
const discussionCommentOptions: github.workflows.DiscussionCommentOptions = { ... }
Properties
| Name | Type | Description |
|---|---|---|
| string[] | Which activity types to trigger on. |
typesOptional
public readonly types: string[];
- Type: string[]
Which activity types to trigger on.
DiscussionOptions
Discussion options.
Initializer
import { github } from 'projen'
const discussionOptions: github.workflows.DiscussionOptions = { ... }
Properties
| Name | Type | Description |
|---|---|---|
| string[] | Which activity types to trigger on. |
typesOptional
public readonly types: string[];
- Type: string[]
Which activity types to trigger on.
ForkOptions
The Fork event accepts no options.
Initializer
import { github } from 'projen'
const forkOptions: github.workflows.ForkOptions = { ... }
GollumOptions
The Gollum event accepts no options.
Initializer
import { github } from 'projen'
const gollumOptions: github.workflows.GollumOptions = { ... }
IssueCommentOptions
Issue comment options.
Initializer
import { github } from 'projen'
const issueCommentOptions: github.workflows.IssueCommentOptions = { ... }
Properties
| Name | Type | Description |
|---|---|---|
| string[] | Which activity types to trigger on. |
typesOptional
public readonly types: string[];
- Type: string[]
Which activity types to trigger on.
IssuesOptions
Issues options.
Initializer
import { github } from 'projen'
const issuesOptions: github.workflows.IssuesOptions = { ... }
Properties
| Name | Type | Description |
|---|---|---|
| string[] | Which activity types to trigger on. |
typesOptional
public readonly types: string[];
- Type: string[]
Which activity types to trigger on.
Job
A GitHub Workflow job definition.
Initializer
import { github } from 'projen'
const job: github.workflows.Job = { ... }
Properties
| Name | Type | Description |
|---|---|---|
| projen.github.workflows.JobPermissions | You can modify the default permissions granted to the GITHUB_TOKEN, adding or removing access as required, so that you only allow the minimum required access. |
| any | Concurrency ensures that only a single job or workflow using the same concurrency group will run at a time. |
| string | You can use the if conditional to prevent a job from running unless a condition is met. |
| string | The name of the job displayed on GitHub. |
| string[] | Identifies any jobs that must complete successfully before this job will run. |
| projen.github.workflows.JobStrategy | A strategy creates a build matrix for your jobs. |
| projen.github.workflows.JobStep[] | A job contains a sequence of tasks called steps. |
| projen.github.workflows.ContainerOptions | A container to run any steps in a job that don't already specify a container. |
| boolean | Prevents a workflow run from failing when a job fails. |
| projen.github.workflows.JobDefaults | A map of default settings that will apply to all steps in the job. |
| {[ key: string ]: string} | A map of environment variables that are available to all steps in the job. |
| any | The environment that the job references. |
| {[ key: string ]: projen.github.workflows.JobStepOutput} | A map of outputs for a job. |
| string[] | The type of machine to run the job on. |
| projen.GroupRunnerOptions | Github Runner Group selection options. |
| {[ key: string ]: projen.github.workflows.ContainerOptions} | Used to host service containers for a job in a workflow. |
| number | The maximum number of minutes to let a job run before GitHub automatically cancels it. |
| projen.github.workflows.Tools | Tools required for this job. |
permissionsRequired
public readonly permissions: JobPermissions;
- Type: projen.github.workflows.JobPermissions
You can modify the default permissions granted to the GITHUB_TOKEN, adding or removing access as required, so that you only allow the minimum required access.
Use { contents: READ } if your job only needs to clone code.
This is intentionally a required field since it is required in order to allow workflows to run in GitHub repositories with restricted default access.
concurrencyOptional
public readonly concurrency: any;
- Type: any
Concurrency ensures that only a single job or workflow using the same concurrency group will run at a time.
A concurrency group can be any string or expression. The expression can use any context except for the secrets context.
ifOptional
public readonly if: string;
- Type: string
You can use the if conditional to prevent a job from running unless a condition is met.
You can use any supported context and expression to create a conditional.
nameOptional
public readonly name: string;
- Type: string
The name of the job displayed on GitHub.
needsOptional
public readonly needs: string[];
- Type: string[]
Identifies any jobs that must complete successfully before this job will run.
It can be a string or array of strings. If a job fails, all jobs that need it are skipped unless the jobs use a conditional expression that causes the job to continue.
strategyOptional
public readonly strategy: JobStrategy;
- Type: projen.github.workflows.JobStrategy
A strategy creates a build matrix for your jobs.
You can define different variations to run each job in.
stepsRequired
public readonly steps: JobStep[];
- Type: projen.github.workflows.JobStep[]
A job contains a sequence of tasks called steps.
Steps can run commands, run setup tasks, or run an action in your repository, a public repository, or an action published in a Docker registry. Not all steps run actions, but all actions run as a step. Each step runs in its own process in the runner environment and has access to the workspace and filesystem. Because steps run in their own process, changes to environment variables are not preserved between steps. GitHub provides built-in steps to set up and complete a job.
containerOptional
public readonly container: ContainerOptions;
- Type: projen.github.workflows.ContainerOptions
A container to run any steps in a job that don't already specify a container.
If you have steps that use both script and container actions, the container actions will run as sibling containers on the same network with the same volume mounts.
continueOnErrorOptional
public readonly continueOnError: boolean;
- Type: boolean
Prevents a workflow run from failing when a job fails.
Set to true to allow a workflow run to pass when this job fails.
defaultsOptional
public readonly defaults: JobDefaults;
- Type: projen.github.workflows.JobDefaults
A map of default settings that will apply to all steps in the job.
You can also set default settings for the entire workflow.
envOptional
public readonly env: {[ key: string ]: string};
- Type: {[ key: string ]: string}
A map of environment variables that are available to all steps in the job.
You can also set environment variables for the entire workflow or an individual step.
environmentOptional
public readonly environment: any;
- Type: any
The environment that the job references.
All environment protection rules must pass before a job referencing the environment is sent to a runner.
outputsOptional
public readonly outputs: {[ key: string ]: JobStepOutput};
- Type: {[ key: string ]: projen.github.workflows.JobStepOutput}
A map of outputs for a job.
Job outputs are available to all downstream jobs that depend on this job.
runsOnOptional
public readonly runsOn: string[];
- Type: string[]
The type of machine to run the job on.
The machine can be either a GitHub-hosted runner or a self-hosted runner.
Example
["ubuntu-latest"]
runsOnGroupOptional
public readonly runsOnGroup: GroupRunnerOptions;
- Type: projen.GroupRunnerOptions
Github Runner Group selection options.
servicesOptional
public readonly services: {[ key: string ]: ContainerOptions};
- Type: {[ key: string ]: projen.github.workflows.ContainerOptions}
Used to host service containers for a job in a workflow.
Service containers are useful for creating databases or cache services like Redis. The runner automatically creates a Docker network and manages the life cycle of the service containers.
timeoutMinutesOptional
public readonly timeoutMinutes: number;
- Type: number
- Default: 360
The maximum number of minutes to let a job run before GitHub automatically cancels it.
toolsOptional
public readonly tools: Tools;
- Type: projen.github.workflows.Tools
Tools required for this job.
Translates into actions/setup-xxx steps at
the beginning of the job.
JobCallingReusableWorkflow
A GitHub Workflow Job calling a reusable workflow.
Initializer
import { github } from 'projen'
const jobCallingReusableWorkflow: github.workflows.JobCallingReusableWorkflow = { ... }
Properties
| Name | Type | Description |
|---|---|---|
| projen.github.workflows.JobPermissions | You can modify the default permissions granted to the GITHUB_TOKEN, adding or removing access as required, so that you only allow the minimum required access. |
| any | Concurrency ensures that only a single job or workflow using the same concurrency group will run at a time. |
| string | You can use the if conditional to prevent a job from running unless a condition is met. |
| string | The name of the job displayed on GitHub. |
| string[] | Identifies any jobs that must complete successfully before this job will run. |
| projen.github.workflows.JobStrategy | A strategy creates a build matrix for your jobs. |
| string | The location and version of a reusable workflow file to run as a job. |
| string | {[ key: string ]: string} | When a job is used to call a reusable workflow, you can use secrets to provide a map of secrets that are passed to the called workflow. |
| {[ key: string ]: string | boolean} | When a job is used to call a reusable workflow, you can use with to provide a map of inputs that are passed to the called workflow. |
permissionsRequired
public readonly permissions: JobPermissions;
- Type: projen.github.workflows.JobPermissions
You can modify the default permissions granted to the GITHUB_TOKEN, adding or removing access as required, so that you only allow the minimum required access.
Use { contents: READ } if your job only needs to clone code.
This is intentionally a required field since it is required in order to allow workflows to run in GitHub repositories with restricted default access.
concurrencyOptional
public readonly concurrency: any;
- Type: any
Concurrency ensures that only a single job or workflow using the same concurrency group will run at a time.
A concurrency group can be any string or expression. The expression can use any context except for the secrets context.
ifOptional
public readonly if: string;
- Type: string
You can use the if conditional to prevent a job from running unless a condition is met.
You can use any supported context and expression to create a conditional.
nameOptional
public readonly name: string;
- Type: string
The name of the job displayed on GitHub.
needsOptional
public readonly needs: string[];
- Type: string[]
Identifies any jobs that must complete successfully before this job will run.
It can be a string or array of strings. If a job fails, all jobs that need it are skipped unless the jobs use a conditional expression that causes the job to continue.
strategyOptional
public readonly strategy: JobStrategy;
- Type: projen.github.workflows.JobStrategy
A strategy creates a build matrix for your jobs.
You can define different variations to run each job in.
usesRequired
public readonly uses: string;
- Type: string
The location and version of a reusable workflow file to run as a job.
secretsOptional
public readonly secrets: string | {[ key: string ]: string};
- Type: string | {[ key: string ]: string}
When a job is used to call a reusable workflow, you can use secrets to provide a map of secrets that are passed to the called workflow.
Use the 'inherit' keyword to pass all the calling workflow's secrets to the called workflow
withOptional
public readonly with: {[ key: string ]: string | boolean};
- Type: {[ key: string ]: string | boolean}
When a job is used to call a reusable workflow, you can use with to provide a map of inputs that are passed to the called workflow.
Allowed expression contexts: github, and needs.
JobDefaults
Default settings for all steps in the job.
Initializer
import { github } from 'projen'
const jobDefaults: github.workflows.JobDefaults = { ... }
Properties
| Name | Type | Description |
|---|---|---|
| projen.github.workflows.RunSettings | Default run settings. |
runOptional
public readonly run: RunSettings;
- Type: projen.github.workflows.RunSettings
Default run settings.
JobMatrix
A job matrix.
Initializer
import { github } from 'projen'
const jobMatrix: github.workflows.JobMatrix = { ... }
Properties
| Name | Type | Description |
|---|---|---|
| {[ key: string ]: string | string | number | boolean[]} | Each option you define in the matrix has a key and value. |
| {[ key: string ]: string | number | boolean}[] | You can remove a specific configurations defined in the build matrix using the exclude option. |
| {[ key: string ]: string | number | boolean}[] | You can add additional configuration options to a build matrix job that already exists. |
domainOptional
public readonly domain: {[ key: string ]: string | (string | number | boolean)[]};
- Type: {[ key: string ]: string | string | number | boolean[]}
Each option you define in the matrix has a key and value.
The keys you define become properties in the matrix context and you can reference the property in other areas of your workflow file. For example, if you define the key os that contains an array of operating systems, you can use the matrix.os property as the value of the runs-on keyword to create a job for each operating system.
excludeOptional
public readonly exclude: ({[ key: string ]: string | number | boolean})[];
- Type: {[ key: string ]: string | number | boolean}[]
You can remove a specific configurations defined in the build matrix using the exclude option.
Using exclude removes a job defined by the build matrix.
includeOptional
public readonly include: ({[ key: string ]: string | number | boolean})[];
- Type: {[ key: string ]: string | number | boolean}[]
You can add additional configuration options to a build matrix job that already exists.
For example, if you want to use a specific version of npm when the job that uses windows-latest and version 8 of node runs, you can use include to specify that additional option.
JobPermissions
The available scopes and access values for workflow permissions.
If you
specify the access for any of these scopes, all those that are not
specified are set to JobPermission.NONE, instead of the default behavior
when none is specified.
Initializer
import { github } from 'projen'
const jobPermissions: github.workflows.JobPermissions = { ... }
Properties
| Name | Type | Description |
|---|---|---|
| projen.github.workflows.JobPermission | No description. |
| projen.github.workflows.JobPermission | No description. |
| projen.github.workflows.JobPermission | No description. |
| projen.github.workflows.JobPermission | No description. |
| projen.github.workflows.JobPermission | No description. |
| projen.github.workflows.JobPermission | No description. |
| projen.github.workflows.JobPermission | No description. |
| projen.github.workflows.JobPermission | No description. |
| projen.github.workflows.JobPermission | No description. |
| projen.github.workflows.JobPermission | No description. |
| projen.github.workflows.JobPermission | No description. |
| projen.github.workflows.JobPermission | No description. |
| projen.github.workflows.JobPermission | No description. |
| projen.github.workflows.JobPermission | No description. |
| projen.github.workflows.JobPermission | No description. |
actionsOptional
public readonly actions: JobPermission;
- Type: projen.github.workflows.JobPermission
attestationsOptional
public readonly attestations: JobPermission;
- Type: projen.github.workflows.JobPermission
checksOptional
public readonly checks: JobPermission;
- Type: projen.github.workflows.JobPermission
contentsOptional
public readonly contents: JobPermission;
- Type: projen.github.workflows.JobPermission
deploymentsOptional
public readonly deployments: JobPermission;
- Type: projen.github.workflows.JobPermission
discussionsOptional
public readonly discussions: JobPermission;
- Type: projen.github.workflows.JobPermission
idTokenOptional
public readonly idToken: JobPermission;
- Type: projen.github.workflows.JobPermission
issuesOptional
public readonly issues: JobPermission;
- Type: projen.github.workflows.JobPermission
modelsOptional
public readonly models: JobPermission;
- Type: projen.github.workflows.JobPermission
packagesOptional
public readonly packages: JobPermission;
- Type: projen.github.workflows.JobPermission
pagesOptional
public readonly pages: JobPermission;
- Type: projen.github.workflows.JobPermission
pullRequestsOptional
public readonly pullRequests: JobPermission;
- Type: projen.github.workflows.JobPermission
repositoryProjectsOptional
repositoryProjects- Deprecated: removed by GitHub
public readonly repositoryProjects: JobPermission;
- Type: projen.github.workflows.JobPermission
securityEventsOptional
public readonly securityEvents: JobPermission;
- Type: projen.github.workflows.JobPermission
statusesOptional
public readonly statuses: JobPermission;
- Type: projen.github.workflows.JobPermission
JobStep
JobSteps run as part of a GitHub Workflow Job.
Initializer
import { github } from 'projen'
const jobStep: github.workflows.JobStep = { ... }
Properties
| Name | Type | Description |
|---|---|---|
| {[ key: string ]: string} | Sets environment variables for steps to use in the runner environment. |
| string | A unique identifier for the step. |
| string | You can use the if conditional to prevent a job from running unless a condition is met. |
| string | A name for your step to display on GitHub. |
| string | Overrides the default shell settings in the runner's operating system and the job's default. |
| string | Specifies a working directory for a step. |
| string | Runs command-line programs using the operating system's shell. |
| string | Selects an action to run as part of a step in your job. |
| {[ key: string ]: any} | A map of the input parameters defined by the action. |
| boolean | Prevents a job from failing when a step fails. |
| number | The maximum number of minutes to run the step before killing the process. |
envOptional
public readonly env: {[ key: string ]: string};
- Type: {[ key: string ]: string}
Sets environment variables for steps to use in the runner environment.
You can also set environment variables for the entire workflow or a job.
idOptional
public readonly id: string;
- Type: string
A unique identifier for the step.
You can use the id to reference the step in contexts.
ifOptional
public readonly if: string;
- Type: string
You can use the if conditional to prevent a job from running unless a condition is met.
You can use any supported context and expression to create a conditional.
nameOptional
public readonly name: string;
- Type: string
A name for your step to display on GitHub.
shellOptional
public readonly shell: string;
- Type: string
Overrides the default shell settings in the runner's operating system and the job's default.
Refer to GitHub documentation for allowed values.
workingDirectoryOptional
public readonly workingDirectory: string;
- Type: string
Specifies a working directory for a step.
Overrides a job's working directory.
runOptional
public readonly run: string;
- Type: string
Runs command-line programs using the operating system's shell.
If you do not provide a name, the step name will default to the text specified in the run command.
usesOptional
public readonly uses: string;
- Type: string
Selects an action to run as part of a step in your job.
An action is a reusable unit of code. You can use an action defined in the same repository as the workflow, a public repository, or in a published Docker container image.
withOptional
public readonly with: {[ key: string ]: any};
- Type: {[ key: string ]: any}
A map of the input parameters defined by the action.
Each input parameter is a key/value pair. Input parameters are set as environment variables. The variable is prefixed with INPUT_ and converted to upper case.
continueOnErrorOptional
public readonly continueOnError: boolean;
- Type: boolean
Prevents a job from failing when a step fails.
Set to true to allow a job to pass when this step fails.
timeoutMinutesOptional
public readonly timeoutMinutes: number;
- Type: number
The maximum number of minutes to run the step before killing the process.
JobStepConfiguration
These settings are unique to a JobStep from the fields contained within the metadata action.yaml file present in when creating a new GitHub Action. These fields are not present in action.yml, but are in JobStep, which are using when creating workflows.
Initializer
import { github } from 'projen'
const jobStepConfiguration: github.workflows.JobStepConfiguration = { ... }
Properties
| Name | Type | Description |
|---|---|---|
| {[ key: string ]: string} | Sets environment variables for steps to use in the runner environment. |
| string | A unique identifier for the step. |
| string | You can use the if conditional to prevent a job from running unless a condition is met. |
| string | A name for your step to display on GitHub. |
| string | Overrides the default shell settings in the runner's operating system and the job's default. |
| string | Specifies a working directory for a step. |
| boolean | Prevents a job from failing when a step fails. |
| number | The maximum number of minutes to run the step before killing the process. |
envOptional
public readonly env: {[ key: string ]: string};
- Type: {[ key: string ]: string}
Sets environment variables for steps to use in the runner environment.
You can also set environment variables for the entire workflow or a job.
idOptional
public readonly id: string;
- Type: string
A unique identifier for the step.
You can use the id to reference the step in contexts.
ifOptional
public readonly if: string;
- Type: string
You can use the if conditional to prevent a job from running unless a condition is met.
You can use any supported context and expression to create a conditional.
nameOptional
public readonly name: string;
- Type: string
A name for your step to display on GitHub.
shellOptional
public readonly shell: string;
- Type: string
Overrides the default shell settings in the runner's operating system and the job's default.
Refer to GitHub documentation for allowed values.
workingDirectoryOptional
public readonly workingDirectory: string;
- Type: string
Specifies a working directory for a step.
Overrides a job's working directory.
continueOnErrorOptional
public readonly continueOnError: boolean;
- Type: boolean
Prevents a job from failing when a step fails.
Set to true to allow a job to pass when this step fails.
timeoutMinutesOptional
public readonly timeoutMinutes: number;
- Type: number
The maximum number of minutes to run the step before killing the process.
JobStepOutput
An output binding for a job.
Initializer
import { github } from 'projen'
const jobStepOutput: github.workflows.JobStepOutput = { ... }
Properties
| Name | Type | Description |
|---|---|---|
| string | The name of the job output that is being bound. |
| string | The ID of the step that exposes the output. |
outputNameRequired
public readonly outputName: string;
- Type: string
The name of the job output that is being bound.
stepIdRequired
public readonly stepId: string;
- Type: string
The ID of the step that exposes the output.
JobStrategy
A strategy creates a build matrix for your jobs.
You can define different variations to run each job in.
Initializer
import { github } from 'projen'
const jobStrategy: github.workflows.JobStrategy = { ... }
Properties
| Name | Type | Description |
|---|---|---|
| boolean | When set to true, GitHub cancels all in-progress jobs if any matrix job fails. |
| projen.github.workflows.JobMatrix | You can define a matrix of different job configurations. |
| number | The maximum number of jobs that can run simultaneously when using a matrix job strategy. |
failFastOptional
public readonly failFast: boolean;
- Type: boolean
When set to true, GitHub cancels all in-progress jobs if any matrix job fails.
Default: true
matrixOptional
public readonly matrix: JobMatrix;
- Type: projen.github.workflows.JobMatrix
You can define a matrix of different job configurations.
A matrix allows you to create multiple jobs by performing variable substitution in a single job definition. For example, you can use a matrix to create jobs for more than one supported version of a programming language, operating system, or tool. A matrix reuses the job's configuration and creates a job for each matrix you configure.
A job matrix can generate a maximum of 256 jobs per workflow run. This limit also applies to self-hosted runners.
maxParallelOptional
public readonly maxParallel: number;
- Type: number
The maximum number of jobs that can run simultaneously when using a matrix job strategy.
By default, GitHub will maximize the number of jobs run in parallel depending on the available runners on GitHub-hosted virtual machines.
LabelOptions
Label options.
Initializer
import { github } from 'projen'
const labelOptions: github.workflows.LabelOptions = { ... }
Properties
| Name | Type | Description |
|---|---|---|
| string[] | Which activity types to trigger on. |
typesOptional
public readonly types: string[];
- Type: string[]
Which activity types to trigger on.
MergeGroupOptions
Merge group options.
Initializer
import { github } from 'projen'
const mergeGroupOptions: github.workflows.MergeGroupOptions = { ... }
Properties
| Name | Type | Description |
|---|---|---|
| string[] | When using the merge_group events, you can configure a workflow to run on specific base branches. |
branchesOptional
public readonly branches: string[];
- Type: string[]
When using the merge_group events, you can configure a workflow to run on specific base branches.
If not specified, all branches will trigger the workflow.
MilestoneOptions
Milestone options.
Initializer
import { github } from 'projen'
const milestoneOptions: github.workflows.MilestoneOptions = { ... }
Properties
| Name | Type | Description |
|---|---|---|
| string[] | Which activity types to trigger on. |
typesOptional
public readonly types: string[];
- Type: string[]
Which activity types to trigger on.
PageBuildOptions
The Page build event accepts no options.
Initializer
import { github } from 'projen'
const pageBuildOptions: github.workflows.PageBuildOptions = { ... }
ProjectCardOptions
Project card options.
Initializer
import { github } from 'projen'
const projectCardOptions: github.workflows.ProjectCardOptions = { ... }
Properties
| Name | Type | Description |
|---|---|---|
| string[] | Which activity types to trigger on. |
typesOptional
public readonly types: string[];
- Type: string[]
Which activity types to trigger on.
ProjectColumnOptions
Probject column options.
Initializer
import { github } from 'projen'
const projectColumnOptions: github.workflows.ProjectColumnOptions = { ... }
Properties
| Name | Type | Description |
|---|---|---|
| string[] | Which activity types to trigger on. |
typesOptional
public readonly types: string[];
- Type: string[]
Which activity types to trigger on.
ProjectOptions
Project options.
Initializer
import { github } from 'projen'
const projectOptions: github.workflows.ProjectOptions = { ... }
Properties
| Name | Type | Description |
|---|---|---|
| string[] | Which activity types to trigger on. |
typesOptional
public readonly types: string[];
- Type: string[]
Which activity types to trigger on.
PublicOptions
The Public event accepts no options.
Initializer
import { github } from 'projen'
const publicOptions: github.workflows.PublicOptions = { ... }
PullRequestOptions
Pull request options.
Initializer
import { github } from 'projen'
const pullRequestOptions: github.workflows.PullRequestOptions = { ... }
Properties
| Name | Type | Description |
|---|---|---|
| string[] | When using the push, pull_request and pull_request_target events, you can configure a workflow to run on specific branches or tags. |
| string[] | When using the push, pull_request and pull_request_target events, you can configure a workflow to run when at least one file does not match paths-ignore or at least one modified file matches the configured paths. |
| string[] | When using the push, pull_request and pull_request_target events, you can configure a workflow to run on specific branches or tags. |
| string[] | Which activity types to trigger on. |
branchesOptional
public readonly branches: string[];
- Type: string[]
When using the push, pull_request and pull_request_target events, you can configure a workflow to run on specific branches or tags.
For a pull_request event, only branches and tags on the base are evaluated. If you define only tags or only branches, the workflow won't run for events affecting the undefined Git ref.
pathsOptional
public readonly paths: string[];
- Type: string[]
When using the push, pull_request and pull_request_target events, you can configure a workflow to run when at least one file does not match paths-ignore or at least one modified file matches the configured paths.
Path filters are not evaluated for pushes to tags.
tagsOptional
public readonly tags: string[];
- Type: string[]
When using the push, pull_request and pull_request_target events, you can configure a workflow to run on specific branches or tags.
For a pull_request event, only branches and tags on the base are evaluated. If you define only tags or only branches, the workflow won't run for events affecting the undefined Git ref.
typesOptional
public readonly types: string[];
- Type: string[]
Which activity types to trigger on.
PullRequestReviewCommentOptions
Pull request review comment options.
Initializer
import { github } from 'projen'
const pullRequestReviewCommentOptions: github.workflows.PullRequestReviewCommentOptions = { ... }
Properties
| Name | Type | Description |
|---|---|---|
| string[] | Which activity types to trigger on. |
typesOptional
public readonly types: string[];
- Type: string[]
Which activity types to trigger on.
PullRequestReviewOptions
Pull request review options.
Initializer
import { github } from 'projen'
const pullRequestReviewOptions: github.workflows.PullRequestReviewOptions = { ... }
Properties
| Name | Type | Description |
|---|---|---|
| string[] | Which activity types to trigger on. |
typesOptional
public readonly types: string[];
- Type: string[]
Which activity types to trigger on.
PullRequestTargetOptions
Pull request target options.
Initializer
import { github } from 'projen'
const pullRequestTargetOptions: github.workflows.PullRequestTargetOptions = { ... }
Properties
| Name | Type | Description |
|---|---|---|
| string[] | When using the push, pull_request and pull_request_target events, you can configure a workflow to run on specific branches or tags. |
| string[] | When using the push, pull_request and pull_request_target events, you can configure a workflow to run when at least one file does not match paths-ignore or at least one modified file matches the configured paths. |
| string[] | When using the push, pull_request and pull_request_target events, you can configure a workflow to run on specific branches or tags. |
| string[] | Which activity types to trigger on. |
branchesOptional
public readonly branches: string[];
- Type: string[]
When using the push, pull_request and pull_request_target events, you can configure a workflow to run on specific branches or tags.
For a pull_request event, only branches and tags on the base are evaluated. If you define only tags or only branches, the workflow won't run for events affecting the undefined Git ref.
pathsOptional
public readonly paths: string[];
- Type: string[]
When using the push, pull_request and pull_request_target events, you can configure a workflow to run when at least one file does not match paths-ignore or at least one modified file matches the configured paths.
Path filters are not evaluated for pushes to tags.
tagsOptional
public readonly tags: string[];
- Type: string[]
When using the push, pull_request and pull_request_target events, you can configure a workflow to run on specific branches or tags.
For a pull_request event, only branches and tags on the base are evaluated. If you define only tags or only branches, the workflow won't run for events affecting the undefined Git ref.
typesOptional
public readonly types: string[];
- Type: string[]
Which activity types to trigger on.
PushOptions
Options for push-like events.
Initializer
import { github } from 'projen'
const pushOptions: github.workflows.PushOptions = { ... }
Properties
| Name | Type | Description |
|---|---|---|
| string[] | When using the push, pull_request and pull_request_target events, you can configure a workflow to run on specific branches or tags. |
| string[] | When using the push, pull_request and pull_request_target events, you can configure a workflow to run when at least one file does not match paths-ignore or at least one modified file matches the configured paths. |
| string[] | When using the push, pull_request and pull_request_target events, you can configure a workflow to run on specific branches or tags. |
branchesOptional
public readonly branches: string[];
- Type: string[]
When using the push, pull_request and pull_request_target events, you can configure a workflow to run on specific branches or tags.
For a pull_request event, only branches and tags on the base are evaluated. If you define only tags or only branches, the workflow won't run for events affecting the undefined Git ref.
pathsOptional
public readonly paths: string[];
- Type: string[]
When using the push, pull_request and pull_request_target events, you can configure a workflow to run when at least one file does not match paths-ignore or at least one modified file matches the configured paths.
Path filters are not evaluated for pushes to tags.
tagsOptional
public readonly tags: string[];
- Type: string[]
When using the push, pull_request and pull_request_target events, you can configure a workflow to run on specific branches or tags.
For a pull_request event, only branches and tags on the base are evaluated. If you define only tags or only branches, the workflow won't run for events affecting the undefined Git ref.
RegistryPackageOptions
Registry package options.
Initializer
import { github } from 'projen'
const registryPackageOptions: github.workflows.RegistryPackageOptions = { ... }
Properties
| Name | Type | Description |
|---|---|---|
| string[] | Which activity types to trigger on. |
typesOptional
public readonly types: string[];
- Type: string[]
Which activity types to trigger on.
ReleaseOptions
Release options.
Initializer
import { github } from 'projen'
const releaseOptions: github.workflows.ReleaseOptions = { ... }
Properties
| Name | Type | Description |
|---|---|---|
| string[] | Which activity types to trigger on. |
typesOptional
public readonly types: string[];
- Type: string[]
Which activity types to trigger on.
RepositoryDispatchOptions
Repository dispatch options.
Initializer
import { github } from 'projen'
const repositoryDispatchOptions: github.workflows.RepositoryDispatchOptions = { ... }
Properties
| Name | Type | Description |
|---|---|---|
| string[] | Which activity types to trigger on. |
typesOptional
public readonly types: string[];
- Type: string[]
Which activity types to trigger on.
RunSettings
Run settings for a job.
Initializer
import { github } from 'projen'
const runSettings: github.workflows.RunSettings = { ... }
Properties
| Name | Type | Description |
|---|---|---|
| string | Which shell to use for running the step. |
| string | Working directory to use when running the step. |
shellOptional
public readonly shell: string;
- Type: string
Which shell to use for running the step.
Example
"bash"
workingDirectoryOptional
public readonly workingDirectory: string;
- Type: string
Working directory to use when running the step.
StatusOptions
The Status event accepts no options.
Initializer
import { github } from 'projen'
const statusOptions: github.workflows.StatusOptions = { ... }
Step
This contains the fields that are common amongst both: - JobStep, which is a step that is part of a Job in Github Actions.
This is by far the most common use case.
- The metadata file
action.yamlthat is used to define an Action when you are creating one. As in, if you were creating an Action to be used in a JobStep. There is some overlap between the two, and this captures that overlap.
https://docs.github.com/en/actions/creating-actions/metadata-syntax-for-github-actions
Initializer
import { github } from 'projen'
const step: github.workflows.Step = { ... }
Properties
| Name | Type | Description |
|---|---|---|
| {[ key: string ]: string} | Sets environment variables for steps to use in the runner environment. |
| string | A unique identifier for the step. |
| string | You can use the if conditional to prevent a job from running unless a condition is met. |
| string | A name for your step to display on GitHub. |
| string | Overrides the default shell settings in the runner's operating system and the job's default. |
| string | Specifies a working directory for a step. |
| string | Runs command-line programs using the operating system's shell. |
| string | Selects an action to run as part of a step in your job. |
| {[ key: string ]: any} | A map of the input parameters defined by the action. |
envOptional
public readonly env: {[ key: string ]: string};
- Type: {[ key: string ]: string}
Sets environment variables for steps to use in the runner environment.
You can also set environment variables for the entire workflow or a job.
idOptional
public readonly id: string;
- Type: string
A unique identifier for the step.
You can use the id to reference the step in contexts.
ifOptional
public readonly if: string;
- Type: string
You can use the if conditional to prevent a job from running unless a condition is met.
You can use any supported context and expression to create a conditional.
nameOptional
public readonly name: string;
- Type: string
A name for your step to display on GitHub.
shellOptional
public readonly shell: string;
- Type: string
Overrides the default shell settings in the runner's operating system and the job's default.
Refer to GitHub documentation for allowed values.
workingDirectoryOptional
public readonly workingDirectory: string;
- Type: string
Specifies a working directory for a step.
Overrides a job's working directory.
runOptional
public readonly run: string;
- Type: string
Runs command-line programs using the operating system's shell.
If you do not provide a name, the step name will default to the text specified in the run command.
usesOptional
public readonly uses: string;
- Type: string
Selects an action to run as part of a step in your job.
An action is a reusable unit of code. You can use an action defined in the same repository as the workflow, a public repository, or in a published Docker container image.
withOptional
public readonly with: {[ key: string ]: any};
- Type: {[ key: string ]: any}
A map of the input parameters defined by the action.
Each input parameter is a key/value pair. Input parameters are set as environment variables. The variable is prefixed with INPUT_ and converted to upper case.
StepConfiguration
Fields that describe the How, Why, When, and Who of a Step.
These fields can have none present, but can be present on every Step, and have no effect on one another.
This stands in contrast to the Command (non-Configuration) fields, which are mutually exclusive, and describe the What.
Initializer
import { github } from 'projen'
const stepConfiguration: github.workflows.StepConfiguration = { ... }
Properties
| Name | Type | Description |
|---|---|---|
| {[ key: string ]: string} | Sets environment variables for steps to use in the runner environment. |
| string | A unique identifier for the step. |
| string | You can use the if conditional to prevent a job from running unless a condition is met. |
| string | A name for your step to display on GitHub. |
| string | Overrides the default shell settings in the runner's operating system and the job's default. |
| string | Specifies a working directory for a step. |
envOptional
public readonly env: {[ key: string ]: string};
- Type: {[ key: string ]: string}
Sets environment variables for steps to use in the runner environment.
You can also set environment variables for the entire workflow or a job.
idOptional
public readonly id: string;
- Type: string
A unique identifier for the step.
You can use the id to reference the step in contexts.
ifOptional
public readonly if: string;
- Type: string
You can use the if conditional to prevent a job from running unless a condition is met.
You can use any supported context and expression to create a conditional.
nameOptional
public readonly name: string;
- Type: string
A name for your step to display on GitHub.
shellOptional
public readonly shell: string;
- Type: string
Overrides the default shell settings in the runner's operating system and the job's default.
Refer to GitHub documentation for allowed values.
workingDirectoryOptional
public readonly workingDirectory: string;
- Type: string
Specifies a working directory for a step.
Overrides a job's working directory.
ToolRequirement
Version requirement for tools.
Initializer
import { github } from 'projen'
const toolRequirement: github.workflows.ToolRequirement = { ... }
Properties
| Name | Type | Description |
|---|---|---|
| string | No description. |
versionRequired
public readonly version: string;
- Type: string
Tools
Supported tools.
Initializer
import { github } from 'projen'
const tools: github.workflows.Tools = { ... }
Properties
| Name | Type | Description |
|---|---|---|
| projen.github.workflows.ToolRequirement | Setup .NET Core. |
| projen.github.workflows.ToolRequirement | Setup golang. |
| projen.github.workflows.ToolRequirement | Setup java (temurin distribution). |
| projen.github.workflows.ToolRequirement | Setup node.js. |
| projen.github.workflows.ToolRequirement | Setup python. |
dotnetOptional
public readonly dotnet: ToolRequirement;
- Type: projen.github.workflows.ToolRequirement
- Default: not installed
Setup .NET Core.
goOptional
public readonly go: ToolRequirement;
- Type: projen.github.workflows.ToolRequirement
- Default: not installed
Setup golang.
javaOptional
public readonly java: ToolRequirement;
- Type: projen.github.workflows.ToolRequirement
- Default: not installed
Setup java (temurin distribution).
nodeOptional
public readonly node: ToolRequirement;
- Type: projen.github.workflows.ToolRequirement
- Default: not installed
Setup node.js.
pythonOptional
public readonly python: ToolRequirement;
- Type: projen.github.workflows.ToolRequirement
- Default: not installed
Setup python.
Triggers
The set of available triggers for GitHub Workflows.
https://docs.github.com/en/actions/reference/events-that-trigger-workflows
Initializer
import { github } from 'projen'
const triggers: github.workflows.Triggers = { ... }
Properties
| Name | Type | Description |
|---|---|---|
| projen.github.workflows.BranchProtectionRuleOptions | Runs your workflow anytime the branch_protection_rule event occurs. |
| projen.github.workflows.CheckRunOptions | Runs your workflow anytime the check_run event occurs. |
| projen.github.workflows.CheckSuiteOptions | Runs your workflow anytime the check_suite event occurs. |
| projen.github.workflows.CreateOptions | Runs your workflow anytime someone creates a branch or tag, which triggers the create event. |
| projen.github.workflows.DeleteOptions | Runs your workflow anytime someone deletes a branch or tag, which triggers the delete event. |
| projen.github.workflows.DeploymentOptions | Runs your workflow anytime someone creates a deployment, which triggers the deployment event. |
| projen.github.workflows.DeploymentStatusOptions | Runs your workflow anytime a third party provides a deployment status, which triggers the deployment_status event. |
| projen.github.workflows.DiscussionOptions | Runs your workflow anytime the discussion event occurs. |
| projen.github.workflows.DiscussionCommentOptions | Runs your workflow anytime the discussion_comment event occurs. |
| projen.github.workflows.ForkOptions | Runs your workflow anytime when someone forks a repository, which triggers the fork event. |
| projen.github.workflows.GollumOptions | Runs your workflow when someone creates or updates a Wiki page, which triggers the gollum event. |
| projen.github.workflows.IssueCommentOptions | Runs your workflow anytime the issue_comment event occurs. |
| projen.github.workflows.IssuesOptions | Runs your workflow anytime the issues event occurs. |
| projen.github.workflows.LabelOptions | Runs your workflow anytime the label event occurs. |
| projen.github.workflows.MergeGroupOptions | Runs your workflow when a pull request is added to a merge queue, which adds the pull request to a merge group. |
| projen.github.workflows.MilestoneOptions | Runs your workflow anytime the milestone event occurs. |
| projen.github.workflows.PageBuildOptions | Runs your workflow anytime someone pushes to a GitHub Pages-enabled branch, which triggers the page_build event. |
| projen.github.workflows.ProjectOptions | Runs your workflow anytime the project event occurs. |
| projen.github.workflows.ProjectCardOptions | Runs your workflow anytime the project_card event occurs. |
| projen.github.workflows.ProjectColumnOptions | Runs your workflow anytime the project_column event occurs. |
| projen.github.workflows.PublicOptions | Runs your workflow anytime someone makes a private repository public, which triggers the public event. |
| projen.github.workflows.PullRequestOptions | Runs your workflow anytime the pull_request event occurs. |
| projen.github.workflows.PullRequestReviewOptions | Runs your workflow anytime the pull_request_review event occurs. |
| projen.github.workflows.PullRequestReviewCommentOptions | Runs your workflow anytime a comment on a pull request's unified diff is modified, which triggers the pull_request_review_comment event. |
| projen.github.workflows.PullRequestTargetOptions | This event runs in the context of the base of the pull request, rather than in the merge commit as the pull_request event does. |
| projen.github.workflows.PushOptions | Runs your workflow when someone pushes to a repository branch, which triggers the push event. |
| projen.github.workflows.RegistryPackageOptions | Runs your workflow anytime a package is published or updated. |
| projen.github.workflows.ReleaseOptions | Runs your workflow anytime the release event occurs. |
| projen.github.workflows.RepositoryDispatchOptions | You can use the GitHub API to trigger a webhook event called repository_dispatch when you want to trigger a workflow for activity that happens outside of GitHub. |
| projen.github.workflows.CronScheduleOptions[] | You can schedule a workflow to run at specific UTC times using POSIX cron syntax. |
| projen.github.workflows.StatusOptions | Runs your workflow anytime the status of a Git commit changes, which triggers the status event. |
| projen.github.workflows.WatchOptions | Runs your workflow anytime the watch event occurs. |
| projen.github.workflows.WorkflowCallOptions | Can be called from another workflow. |
| projen.github.workflows.WorkflowDispatchOptions | You can configure custom-defined input properties, default input values, and required inputs for the event directly in your workflow. |
| projen.github.workflows.WorkflowRunOptions | This event occurs when a workflow run is requested or completed, and allows you to execute a workflow based on the finished result of another workflow. |
branchProtectionRuleOptional
public readonly branchProtectionRule: BranchProtectionRuleOptions;
- Type: projen.github.workflows.BranchProtectionRuleOptions
Runs your workflow anytime the branch_protection_rule event occurs.
checkRunOptional
public readonly checkRun: CheckRunOptions;
- Type: projen.github.workflows.CheckRunOptions
Runs your workflow anytime the check_run event occurs.
checkSuiteOptional
public readonly checkSuite: CheckSuiteOptions;
- Type: projen.github.workflows.CheckSuiteOptions
Runs your workflow anytime the check_suite event occurs.
createOptional
public readonly create: CreateOptions;
- Type: projen.github.workflows.CreateOptions
Runs your workflow anytime someone creates a branch or tag, which triggers the create event.
deleteOptional
public readonly delete: DeleteOptions;
- Type: projen.github.workflows.DeleteOptions
Runs your workflow anytime someone deletes a branch or tag, which triggers the delete event.
deploymentOptional
public readonly deployment: DeploymentOptions;
- Type: projen.github.workflows.DeploymentOptions
Runs your workflow anytime someone creates a deployment, which triggers the deployment event.
Deployments created with a commit SHA may not have a Git ref.
deploymentStatusOptional
public readonly deploymentStatus: DeploymentStatusOptions;
- Type: projen.github.workflows.DeploymentStatusOptions
Runs your workflow anytime a third party provides a deployment status, which triggers the deployment_status event.
Deployments created with a commit SHA may not have a Git ref.
discussionOptional
public readonly discussion: DiscussionOptions;
- Type: projen.github.workflows.DiscussionOptions
Runs your workflow anytime the discussion event occurs.
More than one activity type triggers this event.
https://docs.github.com/en/graphql/guides/using-the-graphql-api-for-discussions
discussionCommentOptional
public readonly discussionComment: DiscussionCommentOptions;
- Type: projen.github.workflows.DiscussionCommentOptions
Runs your workflow anytime the discussion_comment event occurs.
More than one activity type triggers this event.
https://docs.github.com/en/graphql/guides/using-the-graphql-api-for-discussions
forkOptional
public readonly fork: ForkOptions;
- Type: projen.github.workflows.ForkOptions
Runs your workflow anytime when someone forks a repository, which triggers the fork event.
gollumOptional
public readonly gollum: GollumOptions;
- Type: projen.github.workflows.GollumOptions
Runs your workflow when someone creates or updates a Wiki page, which triggers the gollum event.
issueCommentOptional
public readonly issueComment: IssueCommentOptions;
- Type: projen.github.workflows.IssueCommentOptions
Runs your workflow anytime the issue_comment event occurs.
issuesOptional
public readonly issues: IssuesOptions;
- Type: projen.github.workflows.IssuesOptions
Runs your workflow anytime the issues event occurs.
labelOptional
public readonly label: LabelOptions;
- Type: projen.github.workflows.LabelOptions
Runs your workflow anytime the label event occurs.
mergeGroupOptional
public readonly mergeGroup: MergeGroupOptions;
- Type: projen.github.workflows.MergeGroupOptions
Runs your workflow when a pull request is added to a merge queue, which adds the pull request to a merge group.
milestoneOptional
public readonly milestone: MilestoneOptions;
- Type: projen.github.workflows.MilestoneOptions
Runs your workflow anytime the milestone event occurs.
pageBuildOptional
public readonly pageBuild: PageBuildOptions;
- Type: projen.github.workflows.PageBuildOptions
Runs your workflow anytime someone pushes to a GitHub Pages-enabled branch, which triggers the page_build event.
projectOptional
public readonly project: ProjectOptions;
- Type: projen.github.workflows.ProjectOptions
Runs your workflow anytime the project event occurs.
projectCardOptional
public readonly projectCard: ProjectCardOptions;
- Type: projen.github.workflows.ProjectCardOptions
Runs your workflow anytime the project_card event occurs.
projectColumnOptional
public readonly projectColumn: ProjectColumnOptions;
- Type: projen.github.workflows.ProjectColumnOptions
Runs your workflow anytime the project_column event occurs.
publicOptional
public readonly public: PublicOptions;
- Type: projen.github.workflows.PublicOptions
Runs your workflow anytime someone makes a private repository public, which triggers the public event.
pullRequestOptional
public readonly pullRequest: PullRequestOptions;
- Type: projen.github.workflows.PullRequestOptions
Runs your workflow anytime the pull_request event occurs.
pullRequestReviewOptional
public readonly pullRequestReview: PullRequestReviewOptions;
- Type: projen.github.workflows.PullRequestReviewOptions
Runs your workflow anytime the pull_request_review event occurs.
pullRequestReviewCommentOptional
public readonly pullRequestReviewComment: PullRequestReviewCommentOptions;
- Type: projen.github.workflows.PullRequestReviewCommentOptions
Runs your workflow anytime a comment on a pull request's unified diff is modified, which triggers the pull_request_review_comment event.
pullRequestTargetOptional
public readonly pullRequestTarget: PullRequestTargetOptions;
- Type: projen.github.workflows.PullRequestTargetOptions
This event runs in the context of the base of the pull request, rather than in the merge commit as the pull_request event does.
This prevents executing unsafe workflow code from the head of the pull request that could alter your repository or steal any secrets you use in your workflow. This event allows you to do things like create workflows that label and comment on pull requests based on the contents of the event payload.
WARNING: The pull_request_target event is granted read/write repository
token and can access secrets, even when it is triggered from a fork.
Although the workflow runs in the context of the base of the pull request,
you should make sure that you do not check out, build, or run untrusted
code from the pull request with this event. Additionally, any caches
share the same scope as the base branch, and to help prevent cache
poisoning, you should not save the cache if there is a possibility that
the cache contents were altered.
https://securitylab.github.com/research/github-actions-preventing-pwn-requests
pushOptional
public readonly push: PushOptions;
- Type: projen.github.workflows.PushOptions
Runs your workflow when someone pushes to a repository branch, which triggers the push event.
registryPackageOptional
public readonly registryPackage: RegistryPackageOptions;
- Type: projen.github.workflows.RegistryPackageOptions
Runs your workflow anytime a package is published or updated.
releaseOptional
public readonly release: ReleaseOptions;
- Type: projen.github.workflows.ReleaseOptions
Runs your workflow anytime the release event occurs.
repositoryDispatchOptional
public readonly repositoryDispatch: RepositoryDispatchOptions;
- Type: projen.github.workflows.RepositoryDispatchOptions
You can use the GitHub API to trigger a webhook event called repository_dispatch when you want to trigger a workflow for activity that happens outside of GitHub.
scheduleOptional
public readonly schedule: CronScheduleOptions[];
- Type: projen.github.workflows.CronScheduleOptions[]
You can schedule a workflow to run at specific UTC times using POSIX cron syntax.
Scheduled workflows run on the latest commit on the default or base branch. The shortest interval you can run scheduled workflows is once every 5 minutes.
https://pubs.opengroup.org/onlinepubs/9699919799/utilities/crontab.html#tag_20_25_07
statusOptional
public readonly status: StatusOptions;
- Type: projen.github.workflows.StatusOptions
Runs your workflow anytime the status of a Git commit changes, which triggers the status event.
watchOptional
public readonly watch: WatchOptions;
- Type: projen.github.workflows.WatchOptions
Runs your workflow anytime the watch event occurs.
workflowCallOptional
public readonly workflowCall: WorkflowCallOptions;
- Type: projen.github.workflows.WorkflowCallOptions
Can be called from another workflow.
https://docs.github.com/en/actions/learn-github-actions/reusing-workflows
workflowDispatchOptional
public readonly workflowDispatch: WorkflowDispatchOptions;
- Type: projen.github.workflows.WorkflowDispatchOptions
You can configure custom-defined input properties, default input values, and required inputs for the event directly in your workflow.
When the workflow runs, you can access the input values in the github.event.inputs context.
workflowRunOptional
public readonly workflowRun: WorkflowRunOptions;
- Type: projen.github.workflows.WorkflowRunOptions
This event occurs when a workflow run is requested or completed, and allows you to execute a workflow based on the finished result of another workflow.
A workflow run is triggered regardless of the result of the previous workflow.
WatchOptions
Watch options.
Initializer
import { github } from 'projen'
const watchOptions: github.workflows.WatchOptions = { ... }
Properties
| Name | Type | Description |
|---|---|---|
| string[] | Which activity types to trigger on. |
typesOptional
public readonly types: string[];
- Type: string[]
Which activity types to trigger on.
WorkflowCallOptions
The Workflow Call event accepts no options.
Initializer
import { github } from 'projen'
const workflowCallOptions: github.workflows.WorkflowCallOptions = { ... }
WorkflowDispatchOptions
The Workflow dispatch event accepts no options.
Initializer
import { github } from 'projen'
const workflowDispatchOptions: github.workflows.WorkflowDispatchOptions = { ... }
WorkflowRunOptions
Workflow run options.
Initializer
import { github } from 'projen'
const workflowRunOptions: github.workflows.WorkflowRunOptions = { ... }
Properties
| Name | Type | Description |
|---|---|---|
| string[] | Which branches or branch-ignore to limit the trigger to. |
| string[] | Which activity types to trigger on. |
| string[] | Which workflow to trigger on. |
branchesOptional
public readonly branches: string[];
- Type: string[]
Which branches or branch-ignore to limit the trigger to.
typesOptional
public readonly types: string[];
- Type: string[]
Which activity types to trigger on.
workflowsOptional
public readonly workflows: string[];
- Type: string[]
Which workflow to trigger on.
Enums
AppPermission
The permissions available for an access token for a GitHub App.
Members
| Name | Description |
|---|---|
| Read-only acccess. |
| Read-write access. |
| Read-write and admin access. |
READ
Read-only acccess.
WRITE
Read-write access.
ADMIN
Read-write and admin access.
Not all permissions support admin.
JobPermission
Access level for workflow permission scopes.
Members
| Name | Description |
|---|---|
| Read-only access. |
| Read-write access. |
| No access at all. |
READ
Read-only access.
WRITE
Read-write access.
NONE
No access at all.