Documentation
¶
Index ¶
- func GitHubProject_DEFAULT_TASK() *string
- func NewAutoApprove_Override(a AutoApprove, github GitHub, options *AutoApproveOptions)
- func NewAutoMerge_Override(a AutoMerge, github GitHub, options *AutoMergeOptions)
- func NewDependabot_Override(d Dependabot, github GitHub, options *DependabotOptions)
- func NewGitHubProject_Override(g GitHubProject, options *GitHubProjectOptions)deprecated
- func NewGitHub_Override(g GitHub, project projen.Project, options *GitHubOptions)
- func NewGithubWorkflow_Override(g GithubWorkflow, github GitHub, name *string, options *GithubWorkflowOptions)
- func NewMergify_Override(m Mergify, github GitHub, options *MergifyOptions)
- func NewPullRequestLint_Override(p PullRequestLint, github GitHub, options *PullRequestLintOptions)
- func NewPullRequestTemplate_Override(p PullRequestTemplate, github GitHub, options *PullRequestTemplateOptions)
- func NewStale_Override(s Stale, github GitHub, options *StaleOptions)
- func NewTaskWorkflow_Override(t TaskWorkflow, github GitHub, options *TaskWorkflowOptions)
- type AutoApprove
- type AutoApproveOptions
- type AutoMerge
- type AutoMergeOptions
- type Dependabot
- type DependabotIgnore
- type DependabotOptions
- type DependabotRegistry
- type DependabotRegistryType
- type DependabotScheduleInterval
- type GitHub
- type GitHubOptions
- type GitHubProject
- type GitHubProjectOptions
- type GitIdentity
- type GithubCredentials
- type GithubCredentialsAppOptions
- type GithubCredentialsPersonalAccessTokenOptions
- type GithubWorkflow
- type GithubWorkflowOptions
- type IAddConditionsLater
- type IJobProvider
- type Mergify
- type MergifyConditionalOperator
- type MergifyOptions
- type MergifyQueue
- type MergifyRule
- type PullRequestLint
- type PullRequestLintOptions
- type PullRequestTemplate
- type PullRequestTemplateOptions
- type SemanticTitleOptions
- type Stale
- type StaleBehavior
- type StaleOptions
- type TaskWorkflow
- type TaskWorkflowOptions
- type VersioningStrategy
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GitHubProject_DEFAULT_TASK ¶
func GitHubProject_DEFAULT_TASK() *string
func NewAutoApprove_Override ¶
func NewAutoApprove_Override(a AutoApprove, github GitHub, options *AutoApproveOptions)
Experimental.
func NewAutoMerge_Override ¶
func NewAutoMerge_Override(a AutoMerge, github GitHub, options *AutoMergeOptions)
Experimental.
func NewDependabot_Override ¶
func NewDependabot_Override(d Dependabot, github GitHub, options *DependabotOptions)
Experimental.
func NewGitHubProject_Override
deprecated
func NewGitHubProject_Override(g GitHubProject, options *GitHubProjectOptions)
Deprecated: This is a *temporary* class. At the moment, our base project types such as `NodeProject` and `JavaProject` are derived from this, but we want to be able to use these project types outside of GitHub as well. One of the next steps to address this is to abstract workflows so that different "engines" can be used to implement our CI/CD solutions.
func NewGitHub_Override ¶
func NewGitHub_Override(g GitHub, project projen.Project, options *GitHubOptions)
Experimental.
func NewGithubWorkflow_Override ¶
func NewGithubWorkflow_Override(g GithubWorkflow, github GitHub, name *string, options *GithubWorkflowOptions)
Experimental.
func NewMergify_Override ¶
func NewMergify_Override(m Mergify, github GitHub, options *MergifyOptions)
Experimental.
func NewPullRequestLint_Override ¶
func NewPullRequestLint_Override(p PullRequestLint, github GitHub, options *PullRequestLintOptions)
Experimental.
func NewPullRequestTemplate_Override ¶
func NewPullRequestTemplate_Override(p PullRequestTemplate, github GitHub, options *PullRequestTemplateOptions)
Experimental.
func NewStale_Override ¶
func NewStale_Override(s Stale, github GitHub, options *StaleOptions)
Experimental.
func NewTaskWorkflow_Override ¶
func NewTaskWorkflow_Override(t TaskWorkflow, github GitHub, options *TaskWorkflowOptions)
Experimental.
Types ¶
type AutoApprove ¶
type AutoApprove interface {
projen.Component
// Experimental.
Label() *string
// Experimental.
Project() projen.Project
// Called after synthesis.
//
// Order is *not* guaranteed.
// Experimental.
PostSynthesize()
// Called before synthesis.
// Experimental.
PreSynthesize()
// Synthesizes files to the project output directory.
// Experimental.
Synthesize()
}
Auto approve pull requests that meet a criteria. Experimental.
func NewAutoApprove ¶
func NewAutoApprove(github GitHub, options *AutoApproveOptions) AutoApprove
Experimental.
type AutoApproveOptions ¶
type AutoApproveOptions struct {
// Only pull requests authored by these Github usernames will be auto-approved.
// Experimental.
AllowedUsernames *[]*string `field:"optional" json:"allowedUsernames" yaml:"allowedUsernames"`
// Only pull requests with this label will be auto-approved.
// Experimental.
Label *string `field:"optional" json:"label" yaml:"label"`
// Github Runner selection labels.
// Experimental.
RunsOn *[]*string `field:"optional" json:"runsOn" yaml:"runsOn"`
// A GitHub secret name which contains a GitHub Access Token with write permissions for the `pull_request` scope.
//
// This token is used to approve pull requests.
//
// Github forbids an identity to approve its own pull request.
// If your project produces automated pull requests using the Github default token -
// {@link https://docs.github.com/en/actions/reference/authentication-in-a-workflow `GITHUB_TOKEN` }
// - that you would like auto approved, such as when using the `depsUpgrade` property in
// `NodeProjectOptions`, then you must use a different token here.
// Experimental.
Secret *string `field:"optional" json:"secret" yaml:"secret"`
}
Options for 'AutoApprove'. Experimental.
type AutoMerge ¶
type AutoMerge interface {
projen.Component
// Experimental.
Project() projen.Project
// Adds conditions to the auto merge rule.
// Experimental.
AddConditions(conditions ...*string)
// Adds conditions that will be rendered only during synthesis.
// Experimental.
AddConditionsLater(later IAddConditionsLater)
// Called after synthesis.
//
// Order is *not* guaranteed.
// Experimental.
PostSynthesize()
// Called before synthesis.
// Experimental.
PreSynthesize()
// Synthesizes files to the project output directory.
// Experimental.
Synthesize()
}
Sets up mergify to merging approved pull requests.
If `buildJob` is specified, the specified GitHub workflow job ID is required to succeed in order for the PR to be merged.
`approvedReviews` specified the number of code review approvals required for the PR to be merged. Experimental.
func NewAutoMerge ¶
func NewAutoMerge(github GitHub, options *AutoMergeOptions) AutoMerge
Experimental.
type AutoMergeOptions ¶
type AutoMergeOptions struct {
// Number of approved code reviews.
// Experimental.
ApprovedReviews *float64 `field:"optional" json:"approvedReviews" yaml:"approvedReviews"`
// List of labels that will prevent auto-merging.
// Experimental.
BlockingLabels *[]*string `field:"optional" json:"blockingLabels" yaml:"blockingLabels"`
}
Experimental.
type Dependabot ¶
type Dependabot interface {
projen.Component
// The raw dependabot configuration.
// See: https://docs.github.com/en/github/administering-a-repository/configuration-options-for-dependency-updates
//
// Experimental.
Config() interface{}
// Whether or not projen is also upgraded in this config,.
// Experimental.
IgnoresProjen() *bool
// Experimental.
Project() projen.Project
// Ignores a dependency from automatic updates.
// Experimental.
AddIgnore(dependencyName *string, versions ...*string)
// Called after synthesis.
//
// Order is *not* guaranteed.
// Experimental.
PostSynthesize()
// Called before synthesis.
// Experimental.
PreSynthesize()
// Synthesizes files to the project output directory.
// Experimental.
Synthesize()
}
Defines dependabot configuration for node projects.
Since module versions are managed in projen, the versioning strategy will be configured to "lockfile-only" which means that only updates that can be done on the lockfile itself will be proposed. Experimental.
func NewDependabot ¶
func NewDependabot(github GitHub, options *DependabotOptions) Dependabot
Experimental.
type DependabotIgnore ¶
type DependabotIgnore struct {
// Use to ignore updates for dependencies with matching names, optionally using `*` to match zero or more characters.
//
// For Java dependencies, the format of the dependency-name attribute is:
// `groupId:artifactId`, for example: `org.kohsuke:github-api`.
// Experimental.
DependencyName *string `field:"required" json:"dependencyName" yaml:"dependencyName"`
// Use to ignore specific versions or ranges of versions.
//
// If you want to
// define a range, use the standard pattern for the package manager (for
// example: `^1.0.0` for npm, or `~> 2.0` for Bundler).
// Experimental.
Versions *[]*string `field:"optional" json:"versions" yaml:"versions"`
}
You can use the `ignore` option to customize which dependencies are updated.
The ignore option supports the following options. Experimental.
type DependabotOptions ¶
type DependabotOptions struct {
// You can use the `ignore` option to customize which dependencies are updated.
//
// The ignore option supports the following options.
// Experimental.
Ignore *[]*DependabotIgnore `field:"optional" json:"ignore" yaml:"ignore"`
// Ignores updates to `projen`.
//
// This is required since projen updates may cause changes in committed files
// and anti-tamper checks will fail.
//
// Projen upgrades are covered through the `ProjenUpgrade` class.
// Experimental.
IgnoreProjen *bool `field:"optional" json:"ignoreProjen" yaml:"ignoreProjen"`
// List of labels to apply to the created PR's.
// Experimental.
Labels *[]*string `field:"optional" json:"labels" yaml:"labels"`
// Map of package registries to use.
// Experimental.
Registries *map[string]*DependabotRegistry `field:"optional" json:"registries" yaml:"registries"`
// How often to check for new versions and raise pull requests.
// Experimental.
ScheduleInterval DependabotScheduleInterval `field:"optional" json:"scheduleInterval" yaml:"scheduleInterval"`
// The strategy to use when edits manifest and lock files.
// Experimental.
VersioningStrategy VersioningStrategy `field:"optional" json:"versioningStrategy" yaml:"versioningStrategy"`
}
Experimental.
type DependabotRegistry ¶
type DependabotRegistry struct {
// Registry type e.g. 'npm-registry' or 'docker-registry'.
// Experimental.
Type DependabotRegistryType `field:"required" json:"type" yaml:"type"`
// Url for the registry e.g. 'https://npm.pkg.github.com' or 'registry.hub.docker.com'.
// Experimental.
Url *string `field:"required" json:"url" yaml:"url"`
// A reference to a Dependabot secret containing an access key for this registry.
// Experimental.
Key *string `field:"optional" json:"key" yaml:"key"`
// Used with the hex-organization registry type.
// See: https://docs.github.com/en/code-security/supply-chain-security/keeping-your-dependencies-updated-automatically/configuration-options-for-dependency-updates#hex-organization
//
// Experimental.
Organization *string `field:"optional" json:"organization" yaml:"organization"`
// A reference to a Dependabot secret containing the password for the specified user.
// Experimental.
Password *string `field:"optional" json:"password" yaml:"password"`
// For registries with type: python-index, if the boolean value is true, pip esolves dependencies by using the specified URL rather than the base URL of the Python Package Index (by default https://pypi.org/simple).
// Experimental.
ReplacesBase *bool `field:"optional" json:"replacesBase" yaml:"replacesBase"`
// Secret token for dependabot access e.g. '${{ secrets.DEPENDABOT_PACKAGE_TOKEN }}'.
// Experimental.
Token *string `field:"optional" json:"token" yaml:"token"`
// The username that Dependabot uses to access the registry.
// Experimental.
Username *string `field:"optional" json:"username" yaml:"username"`
}
Use to add private registry support for dependabot. See: https://docs.github.com/en/code-security/supply-chain-security/keeping-your-dependencies-updated-automatically/configuration-options-for-dependency-updates#configuration-options-for-private-registries
Experimental.
type DependabotRegistryType ¶
type DependabotRegistryType string
Each configuration type requires you to provide particular settings.
Some types allow more than one way to connect. See: https://docs.github.com/en/code-security/supply-chain-security/keeping-your-dependencies-updated-automatically/configuration-options-for-dependency-updates#configuration-options-for-private-registries
Experimental.
const ( // The composer-repository type supports username and password. // See: https://docs.github.com/en/code-security/supply-chain-security/keeping-your-dependencies-updated-automatically/configuration-options-for-dependency-updates#composer-repository // // Experimental. DependabotRegistryType_COMPOSER_REGISTRY DependabotRegistryType = "COMPOSER_REGISTRY" // The docker-registry type supports username and password. // // The docker-registry type can also be used to pull from Amazon ECR using static AWS credentials. // See: https://docs.github.com/en/code-security/supply-chain-security/keeping-your-dependencies-updated-automatically/configuration-options-for-dependency-updates#docker-registry // // Experimental. DependabotRegistryType_DOCKER_REGISTRY DependabotRegistryType = "DOCKER_REGISTRY" // The git type supports username and password. // See: https://docs.github.com/en/code-security/supply-chain-security/keeping-your-dependencies-updated-automatically/configuration-options-for-dependency-updates#git // // Experimental. DependabotRegistryType_GIT DependabotRegistryType = "GIT" // The hex-organization type supports organization and key. // See: https://docs.github.com/en/code-security/supply-chain-security/keeping-your-dependencies-updated-automatically/configuration-options-for-dependency-updates#hex-organization // // Experimental. DependabotRegistryType_HEX_ORGANIZATION DependabotRegistryType = "HEX_ORGANIZATION" // The maven-repository type supports username and password, or token. // See: https://docs.github.com/en/code-security/supply-chain-security/keeping-your-dependencies-updated-automatically/configuration-options-for-dependency-updates#maven-repository // // Experimental. DependabotRegistryType_MAVEN_REPOSITORY DependabotRegistryType = "MAVEN_REPOSITORY" // The npm-registry type supports username and password, or token. // See: https://docs.github.com/en/code-security/supply-chain-security/keeping-your-dependencies-updated-automatically/configuration-options-for-dependency-updates#npm-registry // // Experimental. DependabotRegistryType_NPM_REGISTRY DependabotRegistryType = "NPM_REGISTRY" // The nuget-feed type supports username and password, or token. // See: https://docs.github.com/en/code-security/supply-chain-security/keeping-your-dependencies-updated-automatically/configuration-options-for-dependency-updates#nuget-feed // // Experimental. DependabotRegistryType_NUGET_FEED DependabotRegistryType = "NUGET_FEED" // The python-index type supports username and password, or token. // See: https://docs.github.com/en/code-security/supply-chain-security/keeping-your-dependencies-updated-automatically/configuration-options-for-dependency-updates#python-index // // Experimental. DependabotRegistryType_PYTHON_INDEX DependabotRegistryType = "PYTHON_INDEX" // The rubygems-server type supports username and password, or token. // See: https://docs.github.com/en/code-security/supply-chain-security/keeping-your-dependencies-updated-automatically/configuration-options-for-dependency-updates#rubygems-server // // Experimental. DependabotRegistryType_RUBYGEMS_SERVER DependabotRegistryType = "RUBYGEMS_SERVER" // The terraform-registry type supports a token. // See: https://docs.github.com/en/code-security/supply-chain-security/keeping-your-dependencies-updated-automatically/configuration-options-for-dependency-updates#terraform-registry // // Experimental. DependabotRegistryType_TERRAFORM_REGISTRY DependabotRegistryType = "TERRAFORM_REGISTRY" )
type DependabotScheduleInterval ¶
type DependabotScheduleInterval string
How often to check for new versions and raise pull requests for version updates. Experimental.
const ( // Runs on every weekday, Monday to Friday. // Experimental. DependabotScheduleInterval_DAILY DependabotScheduleInterval = "DAILY" // Runs once each week. // // By default, this is on Monday. // Experimental. DependabotScheduleInterval_WEEKLY DependabotScheduleInterval = "WEEKLY" // Runs once each month. // // This is on the first day of the month. // Experimental. DependabotScheduleInterval_MONTHLY DependabotScheduleInterval = "MONTHLY" )
type GitHub ¶
type GitHub interface {
projen.Component
// The `Mergify` configured on this repository.
//
// This is `undefined` if Mergify
// was not enabled when creating the repository.
// Experimental.
Mergify() Mergify
// Experimental.
Project() projen.Project
// GitHub API authentication method used by projen workflows.
// Experimental.
ProjenCredentials() GithubCredentials
// All workflows.
// Experimental.
Workflows() *[]GithubWorkflow
// Are workflows enabled?
// Experimental.
WorkflowsEnabled() *bool
// Experimental.
AddDependabot(options *DependabotOptions) Dependabot
// Experimental.
AddPullRequestTemplate(content ...*string) PullRequestTemplate
// Adds a workflow to the project.
//
// Returns: a GithubWorkflow instance.
// Experimental.
AddWorkflow(name *string) GithubWorkflow
// Called after synthesis.
//
// Order is *not* guaranteed.
// Experimental.
PostSynthesize()
// Called before synthesis.
// Experimental.
PreSynthesize()
// Synthesizes files to the project output directory.
// Experimental.
Synthesize()
// Finds a GitHub workflow by name.
//
// Returns `undefined` if the workflow cannot be found.
// Experimental.
TryFindWorkflow(name *string) GithubWorkflow
}
Experimental.
type GitHubOptions ¶
type GitHubOptions struct {
// Whether mergify should be enabled on this repository or not.
// Experimental.
Mergify *bool `field:"optional" json:"mergify" yaml:"mergify"`
// Options for Mergify.
// Experimental.
MergifyOptions *MergifyOptions `field:"optional" json:"mergifyOptions" yaml:"mergifyOptions"`
// Choose a method of providing GitHub API access for projen workflows.
// Experimental.
ProjenCredentials GithubCredentials `field:"optional" json:"projenCredentials" yaml:"projenCredentials"`
// The name of a secret which includes a GitHub Personal Access Token to be used by projen workflows.
//
// This token needs to have the `repo`, `workflows`
// and `packages` scope.
// Deprecated: - use `projenCredentials`.
ProjenTokenSecret *string `field:"optional" json:"projenTokenSecret" yaml:"projenTokenSecret"`
// Add a workflow that performs basic checks for pull requests, like validating that PRs follow Conventional Commits.
// Experimental.
PullRequestLint *bool `field:"optional" json:"pullRequestLint" yaml:"pullRequestLint"`
// Options for configuring a pull request linter.
// Experimental.
PullRequestLintOptions *PullRequestLintOptions `field:"optional" json:"pullRequestLintOptions" yaml:"pullRequestLintOptions"`
// Enables GitHub workflows.
//
// If this is set to `false`, workflows will not be created.
// Experimental.
Workflows *bool `field:"optional" json:"workflows" yaml:"workflows"`
}
Experimental.
type GitHubProject ¶
type GitHubProject interface {
projen.Project
// Auto approve set up for this project.
// Deprecated: This is a *temporary* class. At the moment, our base project
// types such as `NodeProject` and `JavaProject` are derived from this, but we
// want to be able to use these project types outside of GitHub as well. One of
// the next steps to address this is to abstract workflows so that different
// "engines" can be used to implement our CI/CD solutions.
AutoApprove() AutoApprove
// Deprecated: This is a *temporary* class. At the moment, our base project
// types such as `NodeProject` and `JavaProject` are derived from this, but we
// want to be able to use these project types outside of GitHub as well. One of
// the next steps to address this is to abstract workflows so that different
// "engines" can be used to implement our CI/CD solutions.
BuildTask() projen.Task
// Whether to commit the managed files by default.
// Deprecated: This is a *temporary* class. At the moment, our base project
// types such as `NodeProject` and `JavaProject` are derived from this, but we
// want to be able to use these project types outside of GitHub as well. One of
// the next steps to address this is to abstract workflows so that different
// "engines" can be used to implement our CI/CD solutions.
CommitGenerated() *bool
// Deprecated: This is a *temporary* class. At the moment, our base project
// types such as `NodeProject` and `JavaProject` are derived from this, but we
// want to be able to use these project types outside of GitHub as well. One of
// the next steps to address this is to abstract workflows so that different
// "engines" can be used to implement our CI/CD solutions.
CompileTask() projen.Task
// Returns all the components within this project.
// Deprecated: This is a *temporary* class. At the moment, our base project
// types such as `NodeProject` and `JavaProject` are derived from this, but we
// want to be able to use these project types outside of GitHub as well. One of
// the next steps to address this is to abstract workflows so that different
// "engines" can be used to implement our CI/CD solutions.
Components() *[]projen.Component
// This is the "default" task, the one that executes "projen".
//
// Undefined if
// the project is being ejected.
// Deprecated: This is a *temporary* class. At the moment, our base project
// types such as `NodeProject` and `JavaProject` are derived from this, but we
// want to be able to use these project types outside of GitHub as well. One of
// the next steps to address this is to abstract workflows so that different
// "engines" can be used to implement our CI/CD solutions.
DefaultTask() projen.Task
// Project dependencies.
// Deprecated: This is a *temporary* class. At the moment, our base project
// types such as `NodeProject` and `JavaProject` are derived from this, but we
// want to be able to use these project types outside of GitHub as well. One of
// the next steps to address this is to abstract workflows so that different
// "engines" can be used to implement our CI/CD solutions.
Deps() projen.Dependencies
// Access for .devcontainer.json (used for GitHub Codespaces).
//
// This will be `undefined` if devContainer boolean is false.
// Deprecated: This is a *temporary* class. At the moment, our base project
// types such as `NodeProject` and `JavaProject` are derived from this, but we
// want to be able to use these project types outside of GitHub as well. One of
// the next steps to address this is to abstract workflows so that different
// "engines" can be used to implement our CI/CD solutions.
DevContainer() vscode.DevContainer
// Whether or not the project is being ejected.
// Deprecated: This is a *temporary* class. At the moment, our base project
// types such as `NodeProject` and `JavaProject` are derived from this, but we
// want to be able to use these project types outside of GitHub as well. One of
// the next steps to address this is to abstract workflows so that different
// "engines" can be used to implement our CI/CD solutions.
Ejected() *bool
// All files in this project.
// Deprecated: This is a *temporary* class. At the moment, our base project
// types such as `NodeProject` and `JavaProject` are derived from this, but we
// want to be able to use these project types outside of GitHub as well. One of
// the next steps to address this is to abstract workflows so that different
// "engines" can be used to implement our CI/CD solutions.
Files() *[]projen.FileBase
// The .gitattributes file for this repository.
// Deprecated: This is a *temporary* class. At the moment, our base project
// types such as `NodeProject` and `JavaProject` are derived from this, but we
// want to be able to use these project types outside of GitHub as well. One of
// the next steps to address this is to abstract workflows so that different
// "engines" can be used to implement our CI/CD solutions.
Gitattributes() projen.GitAttributesFile
// Access all github components.
//
// This will be `undefined` for subprojects.
// Deprecated: This is a *temporary* class. At the moment, our base project
// types such as `NodeProject` and `JavaProject` are derived from this, but we
// want to be able to use these project types outside of GitHub as well. One of
// the next steps to address this is to abstract workflows so that different
// "engines" can be used to implement our CI/CD solutions.
Github() GitHub
// .gitignore.
// Deprecated: This is a *temporary* class. At the moment, our base project
// types such as `NodeProject` and `JavaProject` are derived from this, but we
// want to be able to use these project types outside of GitHub as well. One of
// the next steps to address this is to abstract workflows so that different
// "engines" can be used to implement our CI/CD solutions.
Gitignore() projen.IgnoreFile
// Access for Gitpod.
//
// This will be `undefined` if gitpod boolean is false.
// Deprecated: This is a *temporary* class. At the moment, our base project
// types such as `NodeProject` and `JavaProject` are derived from this, but we
// want to be able to use these project types outside of GitHub as well. One of
// the next steps to address this is to abstract workflows so that different
// "engines" can be used to implement our CI/CD solutions.
Gitpod() projen.Gitpod
// The options used when this project is bootstrapped via `projen new`.
//
// It
// includes the original set of options passed to the CLI and also the JSII
// FQN of the project type.
// Deprecated: This is a *temporary* class. At the moment, our base project
// types such as `NodeProject` and `JavaProject` are derived from this, but we
// want to be able to use these project types outside of GitHub as well. One of
// the next steps to address this is to abstract workflows so that different
// "engines" can be used to implement our CI/CD solutions.
InitProject() *projen.InitProject
// Logging utilities.
// Deprecated: This is a *temporary* class. At the moment, our base project
// types such as `NodeProject` and `JavaProject` are derived from this, but we
// want to be able to use these project types outside of GitHub as well. One of
// the next steps to address this is to abstract workflows so that different
// "engines" can be used to implement our CI/CD solutions.
Logger() projen.Logger
// Project name.
// Deprecated: This is a *temporary* class. At the moment, our base project
// types such as `NodeProject` and `JavaProject` are derived from this, but we
// want to be able to use these project types outside of GitHub as well. One of
// the next steps to address this is to abstract workflows so that different
// "engines" can be used to implement our CI/CD solutions.
Name() *string
// Absolute output directory of this project.
// Deprecated: This is a *temporary* class. At the moment, our base project
// types such as `NodeProject` and `JavaProject` are derived from this, but we
// want to be able to use these project types outside of GitHub as well. One of
// the next steps to address this is to abstract workflows so that different
// "engines" can be used to implement our CI/CD solutions.
Outdir() *string
// Deprecated: This is a *temporary* class. At the moment, our base project
// types such as `NodeProject` and `JavaProject` are derived from this, but we
// want to be able to use these project types outside of GitHub as well. One of
// the next steps to address this is to abstract workflows so that different
// "engines" can be used to implement our CI/CD solutions.
PackageTask() projen.Task
// A parent project.
//
// If undefined, this is the root project.
// Deprecated: This is a *temporary* class. At the moment, our base project
// types such as `NodeProject` and `JavaProject` are derived from this, but we
// want to be able to use these project types outside of GitHub as well. One of
// the next steps to address this is to abstract workflows so that different
// "engines" can be used to implement our CI/CD solutions.
Parent() projen.Project
// Deprecated: This is a *temporary* class. At the moment, our base project
// types such as `NodeProject` and `JavaProject` are derived from this, but we
// want to be able to use these project types outside of GitHub as well. One of
// the next steps to address this is to abstract workflows so that different
// "engines" can be used to implement our CI/CD solutions.
PostCompileTask() projen.Task
// Deprecated: This is a *temporary* class. At the moment, our base project
// types such as `NodeProject` and `JavaProject` are derived from this, but we
// want to be able to use these project types outside of GitHub as well. One of
// the next steps to address this is to abstract workflows so that different
// "engines" can be used to implement our CI/CD solutions.
PreCompileTask() projen.Task
// Manages the build process of the project.
// Deprecated: This is a *temporary* class. At the moment, our base project
// types such as `NodeProject` and `JavaProject` are derived from this, but we
// want to be able to use these project types outside of GitHub as well. One of
// the next steps to address this is to abstract workflows so that different
// "engines" can be used to implement our CI/CD solutions.
ProjectBuild() projen.ProjectBuild
// Deprecated: This is a *temporary* class. At the moment, our base project
// types such as `NodeProject` and `JavaProject` are derived from this, but we
// want to be able to use these project types outside of GitHub as well. One of
// the next steps to address this is to abstract workflows so that different
// "engines" can be used to implement our CI/CD solutions.
ProjectType() projen.ProjectType
// The command to use in order to run the projen CLI.
// Deprecated: This is a *temporary* class. At the moment, our base project
// types such as `NodeProject` and `JavaProject` are derived from this, but we
// want to be able to use these project types outside of GitHub as well. One of
// the next steps to address this is to abstract workflows so that different
// "engines" can be used to implement our CI/CD solutions.
ProjenCommand() *string
// The root project.
// Deprecated: This is a *temporary* class. At the moment, our base project
// types such as `NodeProject` and `JavaProject` are derived from this, but we
// want to be able to use these project types outside of GitHub as well. One of
// the next steps to address this is to abstract workflows so that different
// "engines" can be used to implement our CI/CD solutions.
Root() projen.Project
// Project tasks.
// Deprecated: This is a *temporary* class. At the moment, our base project
// types such as `NodeProject` and `JavaProject` are derived from this, but we
// want to be able to use these project types outside of GitHub as well. One of
// the next steps to address this is to abstract workflows so that different
// "engines" can be used to implement our CI/CD solutions.
Tasks() projen.Tasks
// Deprecated: This is a *temporary* class. At the moment, our base project
// types such as `NodeProject` and `JavaProject` are derived from this, but we
// want to be able to use these project types outside of GitHub as well. One of
// the next steps to address this is to abstract workflows so that different
// "engines" can be used to implement our CI/CD solutions.
TestTask() projen.Task
// Access all VSCode components.
//
// This will be `undefined` for subprojects.
// Deprecated: This is a *temporary* class. At the moment, our base project
// types such as `NodeProject` and `JavaProject` are derived from this, but we
// want to be able to use these project types outside of GitHub as well. One of
// the next steps to address this is to abstract workflows so that different
// "engines" can be used to implement our CI/CD solutions.
Vscode() vscode.VsCode
// Exclude the matching files from pre-synth cleanup.
//
// Can be used when, for example, some
// source files include the projen marker and we don't want them to be erased during synth.
// Deprecated: This is a *temporary* class. At the moment, our base project
// types such as `NodeProject` and `JavaProject` are derived from this, but we
// want to be able to use these project types outside of GitHub as well. One of
// the next steps to address this is to abstract workflows so that different
// "engines" can be used to implement our CI/CD solutions.
AddExcludeFromCleanup(globs ...*string)
// Adds a .gitignore pattern.
// Deprecated: This is a *temporary* class. At the moment, our base project
// types such as `NodeProject` and `JavaProject` are derived from this, but we
// want to be able to use these project types outside of GitHub as well. One of
// the next steps to address this is to abstract workflows so that different
// "engines" can be used to implement our CI/CD solutions.
AddGitIgnore(pattern *string)
// Exclude these files from the bundled package.
//
// Implemented by project types based on the
// packaging mechanism. For example, `NodeProject` delegates this to `.npmignore`.
// Deprecated: This is a *temporary* class. At the moment, our base project
// types such as `NodeProject` and `JavaProject` are derived from this, but we
// want to be able to use these project types outside of GitHub as well. One of
// the next steps to address this is to abstract workflows so that different
// "engines" can be used to implement our CI/CD solutions.
AddPackageIgnore(_pattern *string)
// Adds a new task to this project.
//
// This will fail if the project already has
// a task with this name.
// Deprecated: This is a *temporary* class. At the moment, our base project
// types such as `NodeProject` and `JavaProject` are derived from this, but we
// want to be able to use these project types outside of GitHub as well. One of
// the next steps to address this is to abstract workflows so that different
// "engines" can be used to implement our CI/CD solutions.
AddTask(name *string, props *projen.TaskOptions) projen.Task
// Prints a "tip" message during synthesis.
// Deprecated: - use `project.logger.info(message)` to show messages during synthesis
AddTip(message *string)
// Marks the provided file(s) as being generated.
//
// This is achieved using the
// github-linguist attributes. Generated files do not count against the
// repository statistics and language breakdown.
// See: https://github.com/github/linguist/blob/master/docs/overrides.md
//
// Deprecated: This is a *temporary* class. At the moment, our base project
// types such as `NodeProject` and `JavaProject` are derived from this, but we
// want to be able to use these project types outside of GitHub as well. One of
// the next steps to address this is to abstract workflows so that different
// "engines" can be used to implement our CI/CD solutions.
AnnotateGenerated(glob *string)
// Called after all components are synthesized.
//
// Order is *not* guaranteed.
// Deprecated: This is a *temporary* class. At the moment, our base project
// types such as `NodeProject` and `JavaProject` are derived from this, but we
// want to be able to use these project types outside of GitHub as well. One of
// the next steps to address this is to abstract workflows so that different
// "engines" can be used to implement our CI/CD solutions.
PostSynthesize()
// Called before all components are synthesized.
// Deprecated: This is a *temporary* class. At the moment, our base project
// types such as `NodeProject` and `JavaProject` are derived from this, but we
// want to be able to use these project types outside of GitHub as well. One of
// the next steps to address this is to abstract workflows so that different
// "engines" can be used to implement our CI/CD solutions.
PreSynthesize()
// Removes a task from a project.
//
// Returns: The `Task` that was removed, otherwise `undefined`.
// Deprecated: This is a *temporary* class. At the moment, our base project
// types such as `NodeProject` and `JavaProject` are derived from this, but we
// want to be able to use these project types outside of GitHub as well. One of
// the next steps to address this is to abstract workflows so that different
// "engines" can be used to implement our CI/CD solutions.
RemoveTask(name *string) projen.Task
// Returns the shell command to execute in order to run a task.
//
// By default, this is `npx projen@<version> <task>`.
// Deprecated: This is a *temporary* class. At the moment, our base project
// types such as `NodeProject` and `JavaProject` are derived from this, but we
// want to be able to use these project types outside of GitHub as well. One of
// the next steps to address this is to abstract workflows so that different
// "engines" can be used to implement our CI/CD solutions.
RunTaskCommand(task projen.Task) *string
// Synthesize all project files into `outdir`.
//
// 1. Call "this.preSynthesize()"
// 2. Delete all generated files
// 3. Synthesize all sub-projects
// 4. Synthesize all components of this project
// 5. Call "postSynthesize()" for all components of this project
// 6. Call "this.postSynthesize()"
// Deprecated: This is a *temporary* class. At the moment, our base project
// types such as `NodeProject` and `JavaProject` are derived from this, but we
// want to be able to use these project types outside of GitHub as well. One of
// the next steps to address this is to abstract workflows so that different
// "engines" can be used to implement our CI/CD solutions.
Synth()
// Finds a file at the specified relative path within this project and all its subprojects.
//
// Returns: a `FileBase` or undefined if there is no file in that path.
// Deprecated: This is a *temporary* class. At the moment, our base project
// types such as `NodeProject` and `JavaProject` are derived from this, but we
// want to be able to use these project types outside of GitHub as well. One of
// the next steps to address this is to abstract workflows so that different
// "engines" can be used to implement our CI/CD solutions.
TryFindFile(filePath *string) projen.FileBase
// Finds a json file by name.
// Deprecated: use `tryFindObjectFile`.
TryFindJsonFile(filePath *string) projen.JsonFile
// Finds an object file (like JsonFile, YamlFile, etc.) by name.
// Deprecated: This is a *temporary* class. At the moment, our base project
// types such as `NodeProject` and `JavaProject` are derived from this, but we
// want to be able to use these project types outside of GitHub as well. One of
// the next steps to address this is to abstract workflows so that different
// "engines" can be used to implement our CI/CD solutions.
TryFindObjectFile(filePath *string) projen.ObjectFile
// Finds a file at the specified relative path within this project and removes it.
//
// Returns: a `FileBase` if the file was found and removed, or undefined if
// the file was not found.
// Deprecated: This is a *temporary* class. At the moment, our base project
// types such as `NodeProject` and `JavaProject` are derived from this, but we
// want to be able to use these project types outside of GitHub as well. One of
// the next steps to address this is to abstract workflows so that different
// "engines" can be used to implement our CI/CD solutions.
TryRemoveFile(filePath *string) projen.FileBase
}
GitHub-based project. Deprecated: This is a *temporary* class. At the moment, our base project types such as `NodeProject` and `JavaProject` are derived from this, but we want to be able to use these project types outside of GitHub as well. One of the next steps to address this is to abstract workflows so that different "engines" can be used to implement our CI/CD solutions.
func NewGitHubProject
deprecated
func NewGitHubProject(options *GitHubProjectOptions) GitHubProject
Deprecated: This is a *temporary* class. At the moment, our base project types such as `NodeProject` and `JavaProject` are derived from this, but we want to be able to use these project types outside of GitHub as well. One of the next steps to address this is to abstract workflows so that different "engines" can be used to implement our CI/CD solutions.
type GitHubProjectOptions ¶
type GitHubProjectOptions struct {
// This is the name of your project.
// Experimental.
Name *string `field:"required" json:"name" yaml:"name"`
// Whether to commit the managed files by default.
// Experimental.
CommitGenerated *bool `field:"optional" json:"commitGenerated" yaml:"commitGenerated"`
// Configure logging options such as verbosity.
// Experimental.
Logging *projen.LoggerOptions `field:"optional" json:"logging" yaml:"logging"`
// The root directory of the project.
//
// Relative to this directory, all files are synthesized.
//
// If this project has a parent, this directory is relative to the parent
// directory and it cannot be the same as the parent or any of it's other
// sub-projects.
// Experimental.
Outdir *string `field:"optional" json:"outdir" yaml:"outdir"`
// The parent project, if this project is part of a bigger project.
// Experimental.
Parent projen.Project `field:"optional" json:"parent" yaml:"parent"`
// The shell command to use in order to run the projen CLI.
//
// Can be used to customize in special environments.
// Experimental.
ProjenCommand *string `field:"optional" json:"projenCommand" yaml:"projenCommand"`
// Generate (once) .projenrc.json (in JSON). Set to `false` in order to disable .projenrc.json generation.
// Experimental.
ProjenrcJson *bool `field:"optional" json:"projenrcJson" yaml:"projenrcJson"`
// Options for .projenrc.json.
// Experimental.
ProjenrcJsonOptions *projen.ProjenrcOptions `field:"optional" json:"projenrcJsonOptions" yaml:"projenrcJsonOptions"`
// Use renovatebot to handle dependency upgrades.
// Experimental.
Renovatebot *bool `field:"optional" json:"renovatebot" yaml:"renovatebot"`
// Options for renovatebot.
// Experimental.
RenovatebotOptions *projen.RenovatebotOptions `field:"optional" json:"renovatebotOptions" yaml:"renovatebotOptions"`
// Enable and configure the 'auto approve' workflow.
// Experimental.
AutoApproveOptions *AutoApproveOptions `field:"optional" json:"autoApproveOptions" yaml:"autoApproveOptions"`
// Enable automatic merging on GitHub.
//
// Has no effect if `github.mergify`
// is set to false.
// Experimental.
AutoMerge *bool `field:"optional" json:"autoMerge" yaml:"autoMerge"`
// Configure options for automatic merging on GitHub.
//
// Has no effect if
// `github.mergify` or `autoMerge` is set to false.
// Experimental.
AutoMergeOptions *AutoMergeOptions `field:"optional" json:"autoMergeOptions" yaml:"autoMergeOptions"`
// Add a `clobber` task which resets the repo to origin.
// Experimental.
Clobber *bool `field:"optional" json:"clobber" yaml:"clobber"`
// Add a VSCode development environment (used for GitHub Codespaces).
// Experimental.
DevContainer *bool `field:"optional" json:"devContainer" yaml:"devContainer"`
// Enable GitHub integration.
//
// Enabled by default for root projects. Disabled for non-root projects.
// Experimental.
Github *bool `field:"optional" json:"github" yaml:"github"`
// Options for GitHub integration.
// Experimental.
GithubOptions *GitHubOptions `field:"optional" json:"githubOptions" yaml:"githubOptions"`
// Add a Gitpod development environment.
// Experimental.
Gitpod *bool `field:"optional" json:"gitpod" yaml:"gitpod"`
// Whether mergify should be enabled on this repository or not.
// Deprecated: use `githubOptions.mergify` instead
Mergify *bool `field:"optional" json:"mergify" yaml:"mergify"`
// Options for mergify.
// Deprecated: use `githubOptions.mergifyOptions` instead
MergifyOptions *MergifyOptions `field:"optional" json:"mergifyOptions" yaml:"mergifyOptions"`
// Which type of project this is (library/app).
// Deprecated: no longer supported at the base project level.
ProjectType projen.ProjectType `field:"optional" json:"projectType" yaml:"projectType"`
// Choose a method of providing GitHub API access for projen workflows.
// Experimental.
ProjenCredentials GithubCredentials `field:"optional" json:"projenCredentials" yaml:"projenCredentials"`
// The name of a secret which includes a GitHub Personal Access Token to be used by projen workflows.
//
// This token needs to have the `repo`, `workflows`
// and `packages` scope.
// Deprecated: use `projenCredentials`.
ProjenTokenSecret *string `field:"optional" json:"projenTokenSecret" yaml:"projenTokenSecret"`
// The README setup.
//
// Example:
// "{ filename: 'readme.md', contents: '# title' }"
//
// Experimental.
Readme *projen.SampleReadmeProps `field:"optional" json:"readme" yaml:"readme"`
// Auto-close of stale issues and pull request.
//
// See `staleOptions` for options.
// Experimental.
Stale *bool `field:"optional" json:"stale" yaml:"stale"`
// Auto-close stale issues and pull requests.
//
// To disable set `stale` to `false`.
// Experimental.
StaleOptions *StaleOptions `field:"optional" json:"staleOptions" yaml:"staleOptions"`
// Enable VSCode integration.
//
// Enabled by default for root projects. Disabled for non-root projects.
// Experimental.
Vscode *bool `field:"optional" json:"vscode" yaml:"vscode"`
}
Options for `GitHubProject`. Experimental.
type GitIdentity ¶
type GitIdentity struct {
// The email address of the git user.
// Experimental.
Email *string `field:"required" json:"email" yaml:"email"`
// The name of the user.
// Experimental.
Name *string `field:"required" json:"name" yaml:"name"`
}
Represents the git identity. Experimental.
type GithubCredentials ¶
type GithubCredentials interface {
// Setup steps to obtain GitHub credentials.
// Experimental.
SetupSteps() *[]*workflows.JobStep
// The value to use in a workflow when a GitHub token is expected.
//
// This
// typically looks like "${{ some.path.to.a.value }}".
// Experimental.
TokenRef() *string
}
Represents a method of providing GitHub API access for projen workflows. Experimental.
func GithubCredentials_FromApp ¶
func GithubCredentials_FromApp(options *GithubCredentialsAppOptions) GithubCredentials
Provide API access through a GitHub App.
The GitHub App must be installed on the GitHub repo, its App ID and a private key must be added as secrets to the repo. The name of the secrets can be specified here. See: https://projen.io/github.html#github-app
Experimental.
func GithubCredentials_FromPersonalAccessToken ¶
func GithubCredentials_FromPersonalAccessToken(options *GithubCredentialsPersonalAccessTokenOptions) GithubCredentials
Provide API access through a GitHub personal access token.
The token must be added as a secret to the GitHub repo, and the name of the secret can be specified here. See: https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token
Experimental.
type GithubCredentialsAppOptions ¶
type GithubCredentialsAppOptions struct {
// Experimental.
AppIdSecret *string `field:"optional" json:"appIdSecret" yaml:"appIdSecret"`
// The permissions granted to the token.
// Experimental.
Permissions *workflows.AppPermissions `field:"optional" json:"permissions" yaml:"permissions"`
// Experimental.
PrivateKeySecret *string `field:"optional" json:"privateKeySecret" yaml:"privateKeySecret"`
}
Options for `GithubCredentials.fromApp`. Experimental.
type GithubCredentialsPersonalAccessTokenOptions ¶
type GithubCredentialsPersonalAccessTokenOptions struct {
// Experimental.
Secret *string `field:"optional" json:"secret" yaml:"secret"`
}
Options for `GithubCredentials.fromPersonalAccessToken`. Experimental.
type GithubWorkflow ¶
type GithubWorkflow interface {
projen.Component
// Concurrency ensures that only a single job or workflow using the same concurrency group will run at a time.
// Experimental.
Concurrency() *string
// The workflow YAML file.
//
// May not exist if `workflowsEnabled` is false on `GitHub`.
// Experimental.
File() projen.YamlFile
// The name of the workflow.
// Experimental.
Name() *string
// Experimental.
Project() projen.Project
// GitHub API authentication method used by projen workflows.
// Experimental.
ProjenCredentials() GithubCredentials
// Adds a single job to the workflow.
// Experimental.
AddJob(id *string, job interface{})
// Add jobs to the workflow.
// Experimental.
AddJobs(jobs *map[string]interface{})
// Add events to triggers the workflow.
// Experimental.
On(events *workflows.Triggers)
// Called after synthesis.
//
// Order is *not* guaranteed.
// Experimental.
PostSynthesize()
// Called before synthesis.
// Experimental.
PreSynthesize()
// Synthesizes files to the project output directory.
// Experimental.
Synthesize()
}
Workflow for GitHub.
A workflow is a configurable automated process made up of one or more jobs. See: https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions
Experimental.
func NewGithubWorkflow ¶
func NewGithubWorkflow(github GitHub, name *string, options *GithubWorkflowOptions) GithubWorkflow
Experimental.
type GithubWorkflowOptions ¶
type GithubWorkflowOptions struct {
// Concurrency ensures that only a single job or workflow using the same concurrency group will run at a time.
//
// Currently in beta.
// See: https://docs.github.com/en/actions/learn-github-actions/workflow-syntax-for-github-actions#concurrency
//
// Experimental.
Concurrency *string `field:"optional" json:"concurrency" yaml:"concurrency"`
// Force the creation of the workflow even if `workflows` is disabled in `GitHub`.
// Experimental.
Force *bool `field:"optional" json:"force" yaml:"force"`
}
Options for `GithubWorkflow`. Experimental.
type IAddConditionsLater ¶
type IAddConditionsLater interface {
// Experimental.
Render() *[]*string
}
Experimental.
type IJobProvider ¶ added in v0.45.0
type IJobProvider interface {
// Generates a collection of named GitHub workflow jobs.
// Experimental.
RenderJobs() *map[string]*workflows.Job
}
Experimental.
type Mergify ¶
type Mergify interface {
projen.Component
// Experimental.
Project() projen.Project
// Experimental.
AddQueue(queue *MergifyQueue)
// Experimental.
AddRule(rule *MergifyRule)
// Called after synthesis.
//
// Order is *not* guaranteed.
// Experimental.
PostSynthesize()
// Called before synthesis.
// Experimental.
PreSynthesize()
// Synthesizes files to the project output directory.
// Experimental.
Synthesize()
}
Experimental.
type MergifyConditionalOperator ¶
type MergifyConditionalOperator struct {
// Experimental.
And *[]interface{} `field:"optional" json:"and" yaml:"and"`
// Experimental.
Or *[]interface{} `field:"optional" json:"or" yaml:"or"`
}
The Mergify conditional operators that can be used are: `or` and `and`.
Note: The number of nested conditions is limited to 3. See: https://docs.mergify.io/conditions/#combining-conditions-with-operators
Experimental.
type MergifyOptions ¶
type MergifyOptions struct {
// Experimental.
Queues *[]*MergifyQueue `field:"optional" json:"queues" yaml:"queues"`
// Experimental.
Rules *[]*MergifyRule `field:"optional" json:"rules" yaml:"rules"`
}
Experimental.
type MergifyQueue ¶
type MergifyQueue struct {
// A list of Conditions string that must match against the pull request for the pull request to be added to the queue.
// See: https://docs.mergify.com/conditions/#conditions
//
// Experimental.
Conditions *[]interface{} `field:"required" json:"conditions" yaml:"conditions"`
// The name of the queue.
// Experimental.
Name *string `field:"required" json:"name" yaml:"name"`
}
Experimental.
type MergifyRule ¶
type MergifyRule struct {
// A dictionary made of Actions that will be executed on the matching pull requests.
// See: https://docs.mergify.io/actions/#actions
//
// Experimental.
Actions *map[string]interface{} `field:"required" json:"actions" yaml:"actions"`
// A list of Conditions string that must match against the pull request for the rule to be applied.
// See: https://docs.mergify.io/conditions/#conditions
//
// Experimental.
Conditions *[]interface{} `field:"required" json:"conditions" yaml:"conditions"`
// The name of the rule.
//
// This is not used by the engine directly,
// but is used when reporting information about a rule.
// Experimental.
Name *string `field:"required" json:"name" yaml:"name"`
}
Experimental.
type PullRequestLint ¶
type PullRequestLint interface {
projen.Component
// Experimental.
Project() projen.Project
// Called after synthesis.
//
// Order is *not* guaranteed.
// Experimental.
PostSynthesize()
// Called before synthesis.
// Experimental.
PreSynthesize()
// Synthesizes files to the project output directory.
// Experimental.
Synthesize()
}
Configure validations to run on GitHub pull requests.
Only generates a file if at least one linter is configured. Experimental.
func NewPullRequestLint ¶
func NewPullRequestLint(github GitHub, options *PullRequestLintOptions) PullRequestLint
Experimental.
type PullRequestLintOptions ¶
type PullRequestLintOptions struct {
// Github Runner selection labels.
// Experimental.
RunsOn *[]*string `field:"optional" json:"runsOn" yaml:"runsOn"`
// Validate that pull request titles follow Conventional Commits.
// See: https://www.conventionalcommits.org/
//
// Experimental.
SemanticTitle *bool `field:"optional" json:"semanticTitle" yaml:"semanticTitle"`
// Options for validating the conventional commit title linter.
// Experimental.
SemanticTitleOptions *SemanticTitleOptions `field:"optional" json:"semanticTitleOptions" yaml:"semanticTitleOptions"`
}
Options for PullRequestLint. Experimental.
type PullRequestTemplate ¶
type PullRequestTemplate interface {
projen.TextFile
// The absolute path of this file.
// Experimental.
AbsolutePath() *string
// Indicates if the file has been changed during synthesis.
//
// This property is
// only available in `postSynthesize()` hooks. If this is `undefined`, the
// file has not been synthesized yet.
// Experimental.
Changed() *bool
// Indicates if the file should be marked as executable.
// Experimental.
Executable() *bool
// Experimental.
SetExecutable(val *bool)
// The projen marker, used to identify files as projen-generated.
//
// Value is undefined if the project is being ejected.
// Experimental.
Marker() *string
// The file path, relative to the project root.
// Experimental.
Path() *string
// Experimental.
Project() projen.Project
// Indicates if the file should be read-only or read-write.
// Experimental.
Readonly() *bool
// Experimental.
SetReadonly(val *bool)
// Adds a line to the text file.
// Experimental.
AddLine(line *string)
// Called after synthesis.
//
// Order is *not* guaranteed.
// Experimental.
PostSynthesize()
// Called before synthesis.
// Experimental.
PreSynthesize()
// Writes the file to the project's output directory.
// Experimental.
Synthesize()
// Implemented by derived classes and returns the contents of the file to emit.
// Experimental.
SynthesizeContent(_arg projen.IResolver) *string
}
Template for GitHub pull requests. Experimental.
func NewPullRequestTemplate ¶
func NewPullRequestTemplate(github GitHub, options *PullRequestTemplateOptions) PullRequestTemplate
Experimental.
type PullRequestTemplateOptions ¶
type PullRequestTemplateOptions struct {
// The contents of the template.
//
// You can use `addLine()` to add additional lines.
// Experimental.
Lines *[]*string `field:"optional" json:"lines" yaml:"lines"`
}
Options for `PullRequestTemplate`. Experimental.
type SemanticTitleOptions ¶
type SemanticTitleOptions struct {
// Configure that a scope must always be provided.
//
// e.g. feat(ui), fix(core)
// Experimental.
RequireScope *bool `field:"optional" json:"requireScope" yaml:"requireScope"`
// Configure a list of commit types that are allowed.
// Experimental.
Types *[]*string `field:"optional" json:"types" yaml:"types"`
}
Options for linting that PR titles follow Conventional Commits. See: https://www.conventionalcommits.org/
Experimental.
type Stale ¶
type Stale interface {
projen.Component
// Experimental.
Project() projen.Project
// Called after synthesis.
//
// Order is *not* guaranteed.
// Experimental.
PostSynthesize()
// Called before synthesis.
// Experimental.
PreSynthesize()
// Synthesizes files to the project output directory.
// Experimental.
Synthesize()
}
Warns and then closes issues and PRs that have had no activity for a specified amount of time.
The default configuration will:
- Add a "Stale" label to pull requests after 14 days and closed after 2 days
- Add a "Stale" label to issues after 60 days and closed after 7 days
- If a comment is added, the label will be removed and timer is restarted.
See: https://github.com/actions/stale
Experimental.
type StaleBehavior ¶
type StaleBehavior struct {
// The comment to add to the issue/PR when it's closed.
// Experimental.
CloseMessage *string `field:"optional" json:"closeMessage" yaml:"closeMessage"`
// Days until the issue/PR is closed after it is marked as "Stale".
//
// Set to -1 to disable.
// Experimental.
DaysBeforeClose *float64 `field:"optional" json:"daysBeforeClose" yaml:"daysBeforeClose"`
// How many days until the issue or pull request is marked as "Stale".
//
// Set to -1 to disable.
// Experimental.
DaysBeforeStale *float64 `field:"optional" json:"daysBeforeStale" yaml:"daysBeforeStale"`
// Determines if this behavior is enabled.
//
// Same as setting `daysBeforeStale` and `daysBeforeClose` to `-1`.
// Experimental.
Enabled *bool `field:"optional" json:"enabled" yaml:"enabled"`
// Label which exempt an issue/PR from becoming stale.
//
// Set to `[]` to disable.
// Experimental.
ExemptLabels *[]*string `field:"optional" json:"exemptLabels" yaml:"exemptLabels"`
// The label to apply to the issue/PR when it becomes stale.
// Experimental.
StaleLabel *string `field:"optional" json:"staleLabel" yaml:"staleLabel"`
// The comment to add to the issue/PR when it becomes stale.
// Experimental.
StaleMessage *string `field:"optional" json:"staleMessage" yaml:"staleMessage"`
}
Stale behavior. Experimental.
type StaleOptions ¶
type StaleOptions struct {
// How to handle stale issues.
// Experimental.
Issues *StaleBehavior `field:"optional" json:"issues" yaml:"issues"`
// How to handle stale pull requests.
// Experimental.
PullRequest *StaleBehavior `field:"optional" json:"pullRequest" yaml:"pullRequest"`
// Github Runner selection labels.
// Experimental.
RunsOn *[]*string `field:"optional" json:"runsOn" yaml:"runsOn"`
}
Options for `Stale`. Experimental.
type TaskWorkflow ¶
type TaskWorkflow interface {
GithubWorkflow
// Experimental.
ArtifactsDirectory() *string
// Concurrency ensures that only a single job or workflow using the same concurrency group will run at a time.
// Experimental.
Concurrency() *string
// The workflow YAML file.
//
// May not exist if `workflowsEnabled` is false on `GitHub`.
// Experimental.
File() projen.YamlFile
// Experimental.
JobId() *string
// The name of the workflow.
// Experimental.
Name() *string
// Experimental.
Project() projen.Project
// GitHub API authentication method used by projen workflows.
// Experimental.
ProjenCredentials() GithubCredentials
// Adds a single job to the workflow.
// Experimental.
AddJob(id *string, job interface{})
// Add jobs to the workflow.
// Experimental.
AddJobs(jobs *map[string]interface{})
// Add events to triggers the workflow.
// Experimental.
On(events *workflows.Triggers)
// Called after synthesis.
//
// Order is *not* guaranteed.
// Experimental.
PostSynthesize()
// Called before synthesis.
// Experimental.
PreSynthesize()
// Synthesizes files to the project output directory.
// Experimental.
Synthesize()
}
A GitHub workflow for common build tasks within a project. Experimental.
func NewTaskWorkflow ¶
func NewTaskWorkflow(github GitHub, options *TaskWorkflowOptions) TaskWorkflow
Experimental.
type TaskWorkflowOptions ¶
type TaskWorkflowOptions struct {
// The workflow name.
// Experimental.
Name *string `field:"required" json:"name" yaml:"name"`
// Permissions for the build job.
// Experimental.
Permissions *workflows.JobPermissions `field:"required" json:"permissions" yaml:"permissions"`
// The main task to be executed.
// Experimental.
Task projen.Task `field:"required" json:"task" yaml:"task"`
// A directory name which contains artifacts to be uploaded (e.g. `dist`). If this is set, the contents of this directory will be uploaded as an artifact at the end of the workflow run, even if other steps fail.
// Experimental.
ArtifactsDirectory *string `field:"optional" json:"artifactsDirectory" yaml:"artifactsDirectory"`
// Override for the `with` property of the source code checkout step.
// Experimental.
CheckoutWith *map[string]interface{} `field:"optional" json:"checkoutWith" yaml:"checkoutWith"`
// Adds an 'if' condition to the workflow.
// Experimental.
Condition *string `field:"optional" json:"condition" yaml:"condition"`
// Experimental.
Container *workflows.ContainerOptions `field:"optional" json:"container" yaml:"container"`
// Workflow environment variables.
// Experimental.
Env *map[string]*string `field:"optional" json:"env" yaml:"env"`
// The git identity to use in this workflow.
// Experimental.
GitIdentity *GitIdentity `field:"optional" json:"gitIdentity" yaml:"gitIdentity"`
// The primary job id.
// Experimental.
JobId *string `field:"optional" json:"jobId" yaml:"jobId"`
// Mapping of job output names to values/expressions.
// Experimental.
Outputs *map[string]*workflows.JobStepOutput `field:"optional" json:"outputs" yaml:"outputs"`
// Actions to run after the main build step.
// Experimental.
PostBuildSteps *[]*workflows.JobStep `field:"optional" json:"postBuildSteps" yaml:"postBuildSteps"`
// Steps to run before the main build step.
// Experimental.
PreBuildSteps *[]*workflows.JobStep `field:"optional" json:"preBuildSteps" yaml:"preBuildSteps"`
// Initial steps to run before the source code checkout.
// Experimental.
PreCheckoutSteps *[]*workflows.JobStep `field:"optional" json:"preCheckoutSteps" yaml:"preCheckoutSteps"`
// Github Runner selection labels.
// Experimental.
RunsOn *[]*string `field:"optional" json:"runsOn" yaml:"runsOn"`
// The triggers for the workflow.
// Experimental.
Triggers *workflows.Triggers `field:"optional" json:"triggers" yaml:"triggers"`
}
Experimental.
type VersioningStrategy ¶
type VersioningStrategy string
The strategy to use when edits manifest and lock files. Experimental.
const ( // Only create pull requests to update lockfiles updates. // // Ignore any new // versions that would require package manifest changes. // Experimental. VersioningStrategy_LOCKFILE_ONLY VersioningStrategy = "LOCKFILE_ONLY" // - For apps, the version requirements are increased. // // - For libraries, the range of versions is widened. // Experimental. VersioningStrategy_AUTO VersioningStrategy = "AUTO" // Relax the version requirement to include both the new and old version, when possible. // Experimental. VersioningStrategy_WIDEN VersioningStrategy = "WIDEN" // Always increase the version requirement to match the new version. // Experimental. VersioningStrategy_INCREASE VersioningStrategy = "INCREASE" // Increase the version requirement only when required by the new version. // Experimental. VersioningStrategy_INCREASE_IF_NECESSARY VersioningStrategy = "INCREASE_IF_NECESSARY" )
Source Files
¶
- github.go
- github_AutoApprove.go
- github_AutoApproveOptions.go
- github_AutoApprove__runtime_type_checks.go
- github_AutoMerge.go
- github_AutoMergeOptions.go
- github_AutoMerge__runtime_type_checks.go
- github_Dependabot.go
- github_DependabotIgnore.go
- github_DependabotOptions.go
- github_DependabotRegistry.go
- github_DependabotRegistryType.go
- github_DependabotScheduleInterval.go
- github_Dependabot__runtime_type_checks.go
- github_GitHub.go
- github_GitHubOptions.go
- github_GitHubProject.go
- github_GitHubProjectOptions.go
- github_GitHubProject__runtime_type_checks.go
- github_GitHub__runtime_type_checks.go
- github_GitIdentity.go
- github_GithubCredentials.go
- github_GithubCredentialsAppOptions.go
- github_GithubCredentialsPersonalAccessTokenOptions.go
- github_GithubCredentials__runtime_type_checks.go
- github_GithubWorkflow.go
- github_GithubWorkflowOptions.go
- github_GithubWorkflow__runtime_type_checks.go
- github_IAddConditionsLater.go
- github_IJobProvider.go
- github_Mergify.go
- github_MergifyConditionalOperator.go
- github_MergifyOptions.go
- github_MergifyQueue.go
- github_MergifyRule.go
- github_Mergify__runtime_type_checks.go
- github_PullRequestLint.go
- github_PullRequestLintOptions.go
- github_PullRequestLint__runtime_type_checks.go
- github_PullRequestTemplate.go
- github_PullRequestTemplateOptions.go
- github_PullRequestTemplate__runtime_type_checks.go
- github_SemanticTitleOptions.go
- github_Stale.go
- github_StaleBehavior.go
- github_StaleOptions.go
- github_Stale__runtime_type_checks.go
- github_TaskWorkflow.go
- github_TaskWorkflowOptions.go
- github_TaskWorkflow__runtime_type_checks.go
- github_VersioningStrategy.go