From d93bc7156a8f4cc04dba1b33fae4d1c14048b4a3 Mon Sep 17 00:00:00 2001 From: Kendra Neil <53584728+TheRealAmazonKendra@users.noreply.github.com> Date: Mon, 5 Aug 2024 12:32:07 -0700 Subject: [PATCH] chore: add auto-approve --- .gitattributes | 1 + .github/workflows/auto-approve.yml | 21 +++++++++++++++++++++ .github/workflows/upgrade.yml | 1 + .gitignore | 2 ++ .projen/files.json | 1 + .projenrc.ts | 7 ++++++- 6 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/auto-approve.yml diff --git a/.gitattributes b/.gitattributes index e3a1375..cadaf6a 100644 --- a/.gitattributes +++ b/.gitattributes @@ -4,6 +4,7 @@ /.eslintrc.json linguist-generated /.gitattributes linguist-generated /.github/pull_request_template.md linguist-generated +/.github/workflows/auto-approve.yml linguist-generated /.github/workflows/build.yml linguist-generated /.github/workflows/pull-request-lint.yml linguist-generated /.github/workflows/upgrade.yml linguist-generated diff --git a/.github/workflows/auto-approve.yml b/.github/workflows/auto-approve.yml new file mode 100644 index 0000000..e083dd2 --- /dev/null +++ b/.github/workflows/auto-approve.yml @@ -0,0 +1,21 @@ +# ~~ Generated by projen. To modify, edit .projenrc.ts and run "npx projen". + +name: auto-approve +on: + pull_request_target: + types: + - labeled + - opened + - synchronize + - reopened + - ready_for_review +jobs: + approve: + runs-on: ubuntu-latest + permissions: + pull-requests: write + if: contains(github.event.pull_request.labels.*.name, 'auto-approve') && (github.event.pull_request.user.login == 'aws-cdk-automation') + steps: + - uses: hmarr/auto-approve-action@v2.2.1 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/upgrade.yml b/.github/workflows/upgrade.yml index e3c2f28..c2b6107 100644 --- a/.github/workflows/upgrade.yml +++ b/.github/workflows/upgrade.yml @@ -71,6 +71,7 @@ jobs: *Automatically created by projen via the "upgrade" workflow* branch: github-actions/upgrade title: "chore(deps): upgrade dependencies" + labels: auto-approve body: |- Upgrades project dependencies. See details in [workflow run]. diff --git a/.gitignore b/.gitignore index ce81f01..73e8e3f 100644 --- a/.gitignore +++ b/.gitignore @@ -4,6 +4,7 @@ !/.projen/deps.json !/.projen/files.json !/.github/workflows/pull-request-lint.yml +!/.github/workflows/auto-approve.yml !/package.json !/LICENSE !/.npmignore @@ -32,6 +33,7 @@ jspm_packages/ .cache **/*.d.ts **/*.js +**/.DS_Store /test-reports/ junit.xml !/jest.config.json diff --git a/.projen/files.json b/.projen/files.json index 7b3307c..5cbfc20 100644 --- a/.projen/files.json +++ b/.projen/files.json @@ -3,6 +3,7 @@ ".eslintrc.json", ".gitattributes", ".github/pull_request_template.md", + ".github/workflows/auto-approve.yml", ".github/workflows/build.yml", ".github/workflows/pull-request-lint.yml", ".github/workflows/upgrade.yml", diff --git a/.projenrc.ts b/.projenrc.ts index c5ed436..a404c4b 100644 --- a/.projenrc.ts +++ b/.projenrc.ts @@ -4,6 +4,11 @@ const project = new typescript.TypeScriptProject({ name: 'cdk-assets', projenrcTs: true, release: false, + autoApproveUpgrades: true, + autoApproveOptions: { + allowedUsernames: ['aws-cdk-automation'], + secret: 'GITHUB_TOKEN', + }, repository: 'https://github.com/cdklabs/cdk-assets.git', keywords: ['aws', 'cdk'], homepage: 'https://github.com/aws/aws-cdk', @@ -71,7 +76,7 @@ const project = new typescript.TypeScriptProject({ include: ['bin/**/*.ts'], }, srcdir: 'lib', - gitignore: ['**/*.d.ts', '**/*.js'], + gitignore: ['**/*.d.ts', '**/*.js', '**/.DS_Store'], }); project.addPackageIgnore('*.ts');