Skip to content

Commit

Permalink
chore: enable auto-approve workflow for providers (#362)
Browse files Browse the repository at this point in the history
  • Loading branch information
xiehan authored Nov 30, 2023
1 parent 18d3d72 commit c37e055
Show file tree
Hide file tree
Showing 5 changed files with 123 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .projenrc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@

import { cdk } from "projen";
import { UpgradeDependenciesSchedule } from "projen/lib/javascript";
import { AutoApprove } from "./projenrc/auto-approve";
import { Automerge } from "./projenrc/automerge";
import { UpgradeNode } from "./projenrc/upgrade-node";
import { AutoApprove } from "./src/auto-approve";
import { CustomizedLicense } from "./src/customized-license";
import { LockIssues } from "./src/lock-issues";

Expand Down
2 changes: 1 addition & 1 deletion projenrc/auto-approve.ts → src/auto-approve.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export class AutoApprove {
steps: [
{
name: "Checkout PR",
uses: "actions/checkout@v3",
uses: "actions/checkout@v4",
with: {
ref: "${{ github.event.pull_request.head.ref }}",
repository:
Expand Down
4 changes: 3 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { TextFile, cdk, github, JsonPatch } from "projen";
import { JobStep } from "projen/lib/github/workflows-model";
import { UpgradeDependenciesSchedule } from "projen/lib/javascript";
import { AlertOpenPrs } from "./alert-open-prs";
import { AutoApprove } from "./auto-approve";
import { AutoCloseCommunityIssues } from "./auto-close-community-issues";
import { CdktfConfig } from "./cdktf-config";
import { CopyrightHeaders } from "./copyright-headers";
Expand Down Expand Up @@ -217,7 +218,7 @@ export class CdktfProviderProject extends cdk.JsiiProject {
eslint: false,
depsUpgradeOptions: {
workflowOptions: {
labels: ["automerge", "dependencies"],
labels: ["automerge", "auto-approve", "dependencies"],
schedule: UpgradeDependenciesSchedule.WEEKLY,
},
},
Expand Down Expand Up @@ -362,6 +363,7 @@ export class CdktfProviderProject extends cdk.JsiiProject {
});
new CustomizedLicense(this, options.creationYear);
new GithubIssues(this, { providerName });
new AutoApprove(this);
new AutoCloseCommunityIssues(this, { providerName });
new LockIssues(this);
new NextVersionPr(this, "${{ secrets.GITHUB_TOKEN }}");
Expand Down
2 changes: 1 addition & 1 deletion src/provider-upgrade.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ export class ProviderUpgrade {
"commit-message": `${semanticType}: upgrade provider from \`${currentVersion}\` to version \`${newVersion}\``,
title: `${semanticType}: upgrade provider from \`${currentVersion}\` to version \`${newVersion}\``,
body: `This PR upgrades the underlying Terraform provider to version ${newVersion}`,
labels: "automerge",
labels: "automerge,auto-approve",
token: "${{ secrets.GH_TOKEN }}",
"delete-branch": true,
committer: "team-tf-cdk <[email protected]>",
Expand Down
123 changes: 117 additions & 6 deletions test/__snapshots__/index.test.ts.snap

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit c37e055

Please sign in to comment.