Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: enable auto-approve workflow for providers #362

Merged
merged 1 commit into from
Nov 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -87,7 +87,7 @@ export class ProviderUpgrade {
branch: "auto/provider-upgrade",
title: `fix: 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.

Loading