-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
- Loading branch information
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,7 @@ import { | |
RunsUsing, | ||
} from "projen-github-action-typescript"; | ||
import { CustomizedLicense } from "./projenrc/customized-license"; | ||
import { LockIssues } from "./projenrc/lock-issues"; | ||
|
||
const inputs = { | ||
cdktfVersion: { | ||
|
@@ -65,6 +66,38 @@ const project = new GitHubActionTypeScriptProject({ | |
prettier: true, | ||
projenrcTs: true, | ||
licensed: false, // we do supply our own license file with a custom header | ||
depsUpgradeOptions: { | ||
workflowOptions: { | ||
labels: ["automerge", "dependencies"], | ||
}, | ||
}, | ||
workflowGitIdentity: { | ||
name: "team-tf-cdk", | ||
email: "[email protected]", | ||
}, | ||
stale: true, | ||
staleOptions: { | ||
issues: { | ||
staleLabel: "stale", | ||
daysBeforeStale: 30, | ||
staleMessage: | ||
"Hi there! 👋 We haven't heard from you in 30 days and would like to know if the problem has been resolved or if " + | ||
"you still need help. If we don't hear from you before then, I'll auto-close this issue in 30 days.", | ||
daysBeforeClose: 30, | ||
closeMessage: | ||
"I'm closing this issue because we haven't heard back in 60 days. ⌛️ If you still need help, feel free to reopen the issue!", | ||
}, | ||
pullRequest: { | ||
staleLabel: "stale", | ||
daysBeforeStale: 60, | ||
staleMessage: | ||
"Hi there! 👋 We haven't heard from you in 60 days and would like to know if you're still working on this or need help. " + | ||
"If we don't hear from you before then, I'll auto-close this PR in 30 days.", | ||
daysBeforeClose: 30, | ||
closeMessage: | ||
"I'm closing this pull request because we haven't heard back in 90 days. ⌛️ If you're still working on this, feel free to reopen the PR or create a new one!", | ||
}, | ||
}, | ||
|
||
actionMetadata: { | ||
author: "HashiCorp, Inc.", | ||
|
@@ -99,6 +132,7 @@ const project = new GitHubActionTypeScriptProject({ | |
}); | ||
|
||
new CustomizedLicense(project); | ||
new LockIssues(project); | ||
|
||
new TextFile(project, "src/inputs.ts", { | ||
committed: true, | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
import { javascript } from "projen"; | ||
import { JobPermission } from "projen/lib/github/workflows-model"; | ||
|
||
/** | ||
* Automatically locks issues and PRs after 30 days. | ||
*/ | ||
export class LockIssues { | ||
constructor(project: javascript.NodeProject) { | ||
const workflow = project.github?.addWorkflow("lock"); | ||
|
||
if (!workflow) throw new Error("no workflow defined"); | ||
|
||
workflow.on({ | ||
schedule: [{ cron: "20 2 * * *" }], | ||
}); | ||
|
||
workflow.addJob("lock", { | ||
runsOn: ["ubuntu-latest"], | ||
permissions: { | ||
pullRequests: JobPermission.WRITE, | ||
issues: JobPermission.WRITE, | ||
}, | ||
steps: [ | ||
{ | ||
uses: "dessant/[email protected]", | ||
with: { | ||
"issue-comment": | ||
`I'm going to lock this issue because it has been closed for at least 30 days. | ||
This helps our maintainers find and focus on the active issues. | ||
If you've found a problem that seems similar to this, please | ||
[open a new issue](https://github.com/hashicorp/terraform-cdk-action/issues/new) | ||
so we can investigate further.`.replace(/\s+/g, " "), | ||
"issue-inactive-days": 30, | ||
"pr-comment": | ||
`I'm going to lock this pull request because it has been closed for at least 30 days. | ||
This helps our maintainers find and focus on the active issues. | ||
If you've found a problem that seems related to this change, please | ||
[open a new issue](https://github.com/hashicorp/terraform-cdk-action/issues/new) | ||
so we can investigate further.`.replace(/\s+/g, " "), | ||
"pr-inactive-days": 30, | ||
}, | ||
}, | ||
], | ||
}); | ||
} | ||
} |