github
Submodule
Constructs
AutoApprove
Auto approve pull requests that meet a criteria.
Initializers
import { github } from 'projen'
new github.AutoApprove(github: GitHub, options?: AutoApproveOptions)
Name | Type | Description |
---|---|---|
|
| No description. |
|
| No description. |
github
Required
- Type: GitHub
options
Optional
- Type: AutoApproveOptions
Methods
Name | Description |
---|---|
| Returns a string representation of this construct. |
| Called after synthesis. |
| Called before synthesis. |
| Synthesizes files to the project output directory. |
toString
public toString(): string
Returns a string representation of this construct.
postSynthesize
public postSynthesize(): void
Called after synthesis.
Order is not guaranteed.
preSynthesize
public preSynthesize(): void
Called before synthesis.
synthesize
public synthesize(): void
Synthesizes files to the project output directory.
Static Functions
Name | Description |
---|---|
| Checks if x is a construct. |
| Test whether the given construct is a component. |
isConstruct
import { github } from 'projen'
github.AutoApprove.isConstruct(x: any)
Checks if x
is a construct.
Use this method instead of instanceof
to properly detect Construct
instances, even when the construct library is symlinked.
Explanation: in JavaScript, multiple copies of the constructs
library on
disk are seen as independent, completely different libraries. As a
consequence, the class Construct
in each copy of the constructs
library
is seen as a different class, and an instance of one class will not test as
instanceof
the other class. npm install
will not create installations
like this, but users may manually symlink construct libraries together or
use a monorepo tool: in those cases, multiple copies of the constructs
library can be accidentally installed, and instanceof
will behave
unpredictably. It is safest to avoid using instanceof
, and using
this type-testing method instead.
x
Required
- Type: any
Any object.
isComponent
import { github } from 'projen'
github.AutoApprove.isComponent(x: any)
Test whether the given construct is a component.
x
Required
- Type: any
Properties
Name | Type | Description |
---|---|---|
| constructs.Node | The tree node. |
| projen.Project | No description. |
| string | No description. |
node
Required
public readonly node: Node;
- Type: constructs.Node
The tree node.
project
Required
public readonly project: Project;
- Type: projen.Project
label
Required
public readonly label: string;
- Type: string
AutoMerge
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.
Initializers
import { github } from 'projen'
new github.AutoMerge(github: GitHub, options?: AutoMergeOptions)
Name | Type | Description |
---|---|---|
|
| No description. |
|
| No description. |
github
Required
- Type: GitHub
options
Optional
- Type: AutoMergeOptions
Methods
Name | Description |
---|---|
| Returns a string representation of this construct. |
| Called after synthesis. |
| Called before synthesis. |
| Synthesizes files to the project output directory. |
| Adds conditions to the auto merge rule. |
| Adds conditions that will be rendered only during synthesis. |
toString
public toString(): string
Returns a string representation of this construct.
postSynthesize
public postSynthesize(): void
Called after synthesis.
Order is not guaranteed.
preSynthesize
public preSynthesize(): void
Called before synthesis.
synthesize
public synthesize(): void
Synthesizes files to the project output directory.
addConditions
public addConditions(conditions: ...string[]): void
Adds conditions to the auto merge rule.
conditions
Required
- Type: ...string[]
The conditions to add (mergify syntax).
addConditionsLater
public addConditionsLater(later: IAddConditionsLater): void
Adds conditions that will be rendered only during synthesis.
later
Required
- Type: IAddConditionsLater
The later.
Static Functions
Name | Description |
---|---|
| Checks if x is a construct. |
| Test whether the given construct is a component. |
isConstruct
import { github } from 'projen'
github.AutoMerge.isConstruct(x: any)
Checks if x
is a construct.
Use this method instead of instanceof
to properly detect Construct
instances, even when the construct library is symlinked.
Explanation: in JavaScript, multiple copies of the constructs
library on
disk are seen as independent, completely different libraries. As a
consequence, the class Construct
in each copy of the constructs
library
is seen as a different class, and an instance of one class will not test as
instanceof
the other class. npm install
will not create installations
like this, but users may manually symlink construct libraries together or
use a monorepo tool: in those cases, multiple copies of the constructs
library can be accidentally installed, and instanceof
will behave
unpredictably. It is safest to avoid using instanceof
, and using
this type-testing method instead.
x
Required
- Type: any
Any object.
isComponent
import { github } from 'projen'
github.AutoMerge.isComponent(x: any)
Test whether the given construct is a component.
x
Required
- Type: any
Properties
Name | Type | Description |
---|---|---|
| constructs.Node | The tree node. |
| projen.Project | No description. |
node
Required
public readonly node: Node;
- Type: constructs.Node
The tree node.
project
Required
public readonly project: Project;
- Type: projen.Project
AutoQueue
Automatically add pull requests to the merge queue PRs will be merged once they pass required checks.
Initializers
import { github } from 'projen'
new github.AutoQueue(scope: IConstruct, options?: AutoQueueOptions)
Name | Type | Description |
---|---|---|
| constructs.IConstruct | No description. |
|
| No description. |
scope
Required
- Type: constructs.IConstruct
options
Optional
- Type: AutoQueueOptions
Methods
Name | Description |
---|---|
| Returns a string representation of this construct. |
| Called after synthesis. |
| Called before synthesis. |
| Synthesizes files to the project output directory. |
toString
public toString(): string
Returns a string representation of this construct.
postSynthesize
public postSynthesize(): void
Called after synthesis.
Order is not guaranteed.
preSynthesize
public preSynthesize(): void
Called before synthesis.
synthesize
public synthesize(): void
Synthesizes files to the project output directory.
Static Functions
Name | Description |
---|---|
| Checks if x is a construct. |
| Test whether the given construct is a component. |
isConstruct
import { github } from 'projen'
github.AutoQueue.isConstruct(x: any)
Checks if x
is a construct.
Use this method instead of instanceof
to properly detect Construct
instances, even when the construct library is symlinked.
Explanation: in JavaScript, multiple copies of the constructs
library on
disk are seen as independent, completely different libraries. As a
consequence, the class Construct
in each copy of the constructs
library
is seen as a different class, and an instance of one class will not test as
instanceof
the other class. npm install
will not create installations
like this, but users may manually symlink construct libraries together or
use a monorepo tool: in those cases, multiple copies of the constructs
library can be accidentally installed, and instanceof
will behave
unpredictably. It is safest to avoid using instanceof
, and using
this type-testing method instead.
x
Required
- Type: any
Any object.
isComponent
import { github } from 'projen'
github.AutoQueue.isComponent(x: any)
Test whether the given construct is a component.
x
Required
- Type: any
Properties
Name | Type | Description |
---|---|---|
| constructs.Node | The tree node. |
| projen.Project | No description. |
node
Required
public readonly node: Node;
- Type: constructs.Node
The tree node.
project
Required
public readonly project: Project;
- Type: projen.Project
Dependabot
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.
Initializers
import { github } from 'projen'
new github.Dependabot(github: GitHub, options?: DependabotOptions)
Name | Type | Description |
---|---|---|
|
| No description. |
|
| No description. |
github
Required
- Type: GitHub
options
Optional
- Type: DependabotOptions
Methods
Name | Description |
---|---|
| Returns a string representation of this construct. |
| Called after synthesis. |
| Called before synthesis. |
| Synthesizes files to the project output directory. |
| Allows a dependency from automatic updates. |
| Ignores a dependency from automatic updates. |
toString
public toString(): string
Returns a string representation of this construct.
postSynthesize
public postSynthesize(): void
Called after synthesis.
Order is not guaranteed.
preSynthesize
public preSynthesize(): void
Called before synthesis.
synthesize
public synthesize(): void
Synthesizes files to the project output directory.
addAllow
public addAllow(dependencyName: string): void
Allows a dependency from automatic updates.
dependencyName
Required
- Type: string
Use to allow updates for dependencies with matching names, optionally using *
to match zero or more characters.
addIgnore
public addIgnore(dependencyName: string, versions: ...string[]): void
Ignores a dependency from automatic updates.
dependencyName
Required
- Type: string
Use to ignore updates for dependencies with matching names, optionally using *
to match zero or more characters.
versions
Required
- Type: ...string[]
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).
Static Functions
Name | Description |
---|---|
| Checks if x is a construct. |
| Test whether the given construct is a component. |
isConstruct
import { github } from 'projen'
github.Dependabot.isConstruct(x: any)
Checks if x
is a construct.
Use this method instead of instanceof
to properly detect Construct
instances, even when the construct library is symlinked.
Explanation: in JavaScript, multiple copies of the constructs
library on
disk are seen as independent, completely different libraries. As a
consequence, the class Construct
in each copy of the constructs
library
is seen as a different class, and an instance of one class will not test as
instanceof
the other class. npm install
will not create installations
like this, but users may manually symlink construct libraries together or
use a monorepo tool: in those cases, multiple copies of the constructs
library can be accidentally installed, and instanceof
will behave
unpredictably. It is safest to avoid using instanceof
, and using
this type-testing method instead.
x
Required
- Type: any
Any object.
isComponent
import { github } from 'projen'
github.Dependabot.isComponent(x: any)
Test whether the given construct is a component.
x
Required
- Type: any
Properties
Name | Type | Description |
---|---|---|
| constructs.Node | The tree node. |
| projen.Project | No description. |
| any | The raw dependabot configuration. |
| boolean | Whether or not projen is also upgraded in this config,. |
node
Required
public readonly node: Node;
- Type: constructs.Node
The tree node.
project
Required
public readonly project: Project;
- Type: projen.Project
config
Required
public readonly config: any;
- Type: any
The raw dependabot configuration.
ignoresProjen
Required
public readonly ignoresProjen: boolean;
- Type: boolean
Whether or not projen is also upgraded in this config,.
GitHub
Initializers
import { github } from 'projen'
new github.GitHub(project: Project, options?: GitHubOptions)
Name | Type | Description |
---|---|---|
| projen.Project | No description. |
|
| No description. |
project
Required
- Type: projen.Project
options
Optional
- Type: GitHubOptions
Methods
Name | Description |
---|---|
| Returns a string representation of this construct. |
| Called after synthesis. |
| Called before synthesis. |
| Synthesizes files to the project output directory. |
| No description. |
| No description. |
| Adds a workflow to the project. |
| Finds a GitHub workflow by name. |
toString
public toString(): string
Returns a string representation of this construct.
postSynthesize
public postSynthesize(): void
Called after synthesis.
Order is not guaranteed.
preSynthesize
public preSynthesize(): void
Called before synthesis.
synthesize
public synthesize(): void
Synthesizes files to the project output directory.
addDependabot
public addDependabot(options?: DependabotOptions): Dependabot
options
Optional
- Type: DependabotOptions
addPullRequestTemplate
public addPullRequestTemplate(content: ...string[]): PullRequestTemplate
content
Required
- Type: ...string[]
addWorkflow
public addWorkflow(name: string): GithubWorkflow
Adds a workflow to the project.
name
Required
- Type: string
Name of the workflow.
tryFindWorkflow
public tryFindWorkflow(name: string): GithubWorkflow
Finds a GitHub workflow by name.
Returns undefined
if the workflow cannot be found.
name
Required
- Type: string
The name of the GitHub workflow.
Static Functions
Name | Description |
---|---|
| Checks if x is a construct. |
| Test whether the given construct is a component. |
| Returns the GitHub component of a project or undefined if the project does not have a GitHub component. |
isConstruct
import { github } from 'projen'
github.GitHub.isConstruct(x: any)
Checks if x
is a construct.
Use this method instead of instanceof
to properly detect Construct
instances, even when the construct library is symlinked.
Explanation: in JavaScript, multiple copies of the constructs
library on
disk are seen as independent, completely different libraries. As a
consequence, the class Construct
in each copy of the constructs
library
is seen as a different class, and an instance of one class will not test as
instanceof
the other class. npm install
will not create installations
like this, but users may manually symlink construct libraries together or
use a monorepo tool: in those cases, multiple copies of the constructs
library can be accidentally installed, and instanceof
will behave
unpredictably. It is safest to avoid using instanceof
, and using
this type-testing method instead.
x
Required
- Type: any
Any object.
isComponent
import { github } from 'projen'
github.GitHub.isComponent(x: any)
Test whether the given construct is a component.
x
Required
- Type: any
of
import { github } from 'projen'
github.GitHub.of(project: Project)
Returns the GitHub
component of a project or undefined
if the project does not have a GitHub component.
project
Required
- Type: projen.Project
Properties
Name | Type | Description |
---|---|---|
| constructs.Node | The tree node. |
| projen.Project | No description. |
|
| The GitHub Actions provider used to manage the versions of actions used in steps. |
| boolean | Whether downloading from LFS is enabled for this GitHub project. |
|
| GitHub API authentication method used by projen workflows. |
|
| All workflows. |
| boolean | Are workflows enabled? |
|
| The MergeQueue component configured on this repository This is undefined if merge queues are not enabled for this repository. |
|
| The Mergify component configured on this repository This is undefined if Mergify is not enabled for this repository. |
node
Required
public readonly node: Node;
- Type: constructs.Node
The tree node.
project
Required
public readonly project: Project;
- Type: projen.Project
actions
Required
public readonly actions: GitHubActionsProvider;
- Type: GitHubActionsProvider
The GitHub Actions provider used to manage the versions of actions used in steps.
downloadLfs
Required
public readonly downloadLfs: boolean;
- Type: boolean
Whether downloading from LFS is enabled for this GitHub project.
projenCredentials
Required
public readonly projenCredentials: GithubCredentials;
- Type: GithubCredentials
GitHub API authentication method used by projen workflows.
workflows
Required
public readonly workflows: GithubWorkflow[];
- Type: GithubWorkflow[]
All workflows.
workflowsEnabled
Required
public readonly workflowsEnabled: boolean;
- Type: boolean
Are workflows enabled?
mergeQueue
Optional
public readonly mergeQueue: MergeQueue;
- Type: MergeQueue
The MergeQueue
component configured on this repository This is undefined
if merge queues are not enabled for this repository.
mergify
Optional
public readonly mergify: Mergify;
- Type: Mergify
The Mergify
component configured on this repository This is undefined
if Mergify is not enabled for this repository.
GitHubProject
GitHub-based project.
Initializers
import { github } from 'projen'
new github.GitHubProject(options: GitHubProjectOptions)
Name | Type | Description |
---|---|---|
|
| No description. |