diff --git a/.gitattributes b/.gitattributes index 9c84ee52f..3d86cfbd4 100644 --- a/.gitattributes +++ b/.gitattributes @@ -9,6 +9,7 @@ /.github/workflows/auto-approve.yml linguist-generated /.github/workflows/auto-close-community-issues.yml linguist-generated /.github/workflows/auto-close-community-prs.yml linguist-generated +/.github/workflows/automerge.yml linguist-generated /.github/workflows/build.yml linguist-generated /.github/workflows/force-release.yml linguist-generated /.github/workflows/lock.yml linguist-generated @@ -19,7 +20,6 @@ /.github/workflows/stale.yml linguist-generated /.github/workflows/upgrade-main.yml linguist-generated /.gitignore linguist-generated -/.mergify.yml linguist-generated /.npmignore linguist-generated /.projen/** linguist-generated /.projen/deps.json linguist-generated diff --git a/.github/workflows/automerge.yml b/.github/workflows/automerge.yml new file mode 100644 index 000000000..2c31f4d36 --- /dev/null +++ b/.github/workflows/automerge.yml @@ -0,0 +1,26 @@ +# ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen". + +name: automerge +on: + pull_request_target: + types: + - opened + - labeled + - ready_for_review + - reopened + - synchronize +concurrency: ${{ github.workflow }}-${{ github.ref }} +jobs: + automerge: + runs-on: ubuntu-latest + permissions: + contents: read + if: contains(github.event.pull_request.labels.*.name, 'automerge') && !contains(github.event.pull_request.labels.*.name, 'do-not-merge') && github.event.pull_request.draft == false + steps: + - name: Checkout + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 + - name: Turn on automerge for this PR by a trusted user or bot + if: github.event.pull_request.user.login == 'team-tf-cdk' || contains(fromJSON('["OWNER", "MEMBER", "COLLABORATOR"]'), github.event.pull_request.author_association) || github.actor == 'dependabot[bot]' + env: + GH_TOKEN: ${{ secrets.PROJEN_GITHUB_TOKEN }} + run: gh pr merge --auto --squash ${{ github.event.pull_request.number }} diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml index 45182cf58..cfbb5bd1f 100644 --- a/.github/workflows/stale.yml +++ b/.github/workflows/stale.yml @@ -16,12 +16,12 @@ jobs: with: days-before-stale: -1 days-before-close: -1 - days-before-pr-stale: 14 - days-before-pr-close: 7 - stale-pr-message: 14 days have passed since this PR was opened, and I assume other builds have succeeded in the meantime. If no one removes the `stale` label or comments, I'm going to auto-close this PR in 7 days. - close-pr-message: I'm closing this PR automatically with the assumption that other builds have succeeded in the meantime. + days-before-pr-stale: 1 + days-before-pr-close: 0 + stale-pr-message: Closing this PR, if it has not merged there is most likely a CI or CDKTF issue preventing it from merging. If this has been a manual PR, please reopen it and add the `no-auto-close` label to prevent this from happening again. + close-pr-message: Closing this pull request as it hasn't seen activity for a while. Please add a comment @mentioning a maintainer to reopen. If you wish to exclude this issue from being marked as stale, add the "no-auto-close" label. stale-pr-label: stale - exempt-pr-labels: backlog + exempt-pr-labels: no-auto-close days-before-issue-stale: 45 days-before-issue-close: 14 stale-issue-message: 45 days have passed since this issue was opened, and I assume other publishes have succeeded in the meantime. If no one removes the `stale` label or comments, I'm going to auto-close this issue in 14 days. diff --git a/.gitignore b/.gitignore index ed07c7848..e3679ef57 100644 --- a/.gitignore +++ b/.gitignore @@ -3,7 +3,6 @@ !/.projen/tasks.json !/.projen/deps.json !/.projen/files.json -!/.mergify.yml !/.github/workflows/pull-request-lint.yml !/.github/workflows/stale.yml !/package.json @@ -57,6 +56,7 @@ package-lock.json !/.github/workflows/auto-approve.yml !/.github/workflows/auto-close-community-issues.yml !/.github/workflows/auto-close-community-prs.yml +!/.github/workflows/automerge.yml !/.github/workflows/lock.yml !/.github/workflows/next-cdktf-version-pr.yml !/.github/workflows/alert-open-prs.yml diff --git a/.mergify.yml b/.mergify.yml deleted file mode 100644 index 72d08e225..000000000 --- a/.mergify.yml +++ /dev/null @@ -1,52 +0,0 @@ -# ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen". - -queue_rules: - - name: default - update_method: merge - conditions: - - "#approved-reviews-by>=1" - - -label~=(do-not-merge) - - status-success=build - - status-success=package-js - - status-success=package-java - - status-success=package-python - - status-success=package-dotnet - - status-success=package-go -pull_request_rules: - - name: Automatically approve PRs with automerge label - actions: - review: - type: APPROVE - message: Automatically approved due to label - conditions: - - label=automerge - - -label~=(do-not-merge) - - -draft - - author=team-tf-cdk - - name: Automatically close stale PRs - actions: - close: - message: Closing this automatic PR, if it has not merged there is most likely a CI or CDKTF issue preventing it from merging - conditions: - - author=team-tf-cdk - - -draft - - created-at<1 day ago - - name: Automatic merge on approval and successful build - actions: - delete_head_branch: {} - queue: - method: squash - name: default - commit_message_template: |- - {{ title }} (#{{ number }}) - - {{ body }} - conditions: - - "#approved-reviews-by>=1" - - -label~=(do-not-merge) - - status-success=build - - status-success=package-js - - status-success=package-java - - status-success=package-python - - status-success=package-dotnet - - status-success=package-go diff --git a/.npmignore b/.npmignore index f53a30996..88d99b10a 100644 --- a/.npmignore +++ b/.npmignore @@ -3,7 +3,6 @@ permissions-backup.acl /dist/changelog.md /dist/version.txt -/.mergify.yml /test/ /tsconfig.dev.json /src/ diff --git a/.projen/files.json b/.projen/files.json index 52f25ae3e..24d5d19e8 100644 --- a/.projen/files.json +++ b/.projen/files.json @@ -9,6 +9,7 @@ ".github/workflows/auto-approve.yml", ".github/workflows/auto-close-community-issues.yml", ".github/workflows/auto-close-community-prs.yml", + ".github/workflows/automerge.yml", ".github/workflows/build.yml", ".github/workflows/force-release.yml", ".github/workflows/lock.yml", @@ -19,7 +20,6 @@ ".github/workflows/stale.yml", ".github/workflows/upgrade-main.yml", ".gitignore", - ".mergify.yml", ".projen/deps.json", ".projen/files.json", ".projen/tasks.json", diff --git a/yarn.lock b/yarn.lock index 098d64c62..7676af4b1 100644 --- a/yarn.lock +++ b/yarn.lock @@ -201,9 +201,9 @@ jsii-srcmak "^0.1.954" "@cdktf/provider-project@^0.4.0": - version "0.4.5" - resolved "https://registry.yarnpkg.com/@cdktf/provider-project/-/provider-project-0.4.5.tgz#608aee4c0f96cb19280a931ae7f917063dd73e18" - integrity sha512-0yqrXgpNOhtM8vjOwdcR+U/5/CcxVcH4uYQqSdusSH3g8Dwd/yv/ipABhjeBJ8r5vgxcncDTxFNbCwbW6PdK+Q== + version "0.4.6" + resolved "https://registry.yarnpkg.com/@cdktf/provider-project/-/provider-project-0.4.6.tgz#203044a61b1cabc4ed4d5f640e510b6d93e853d9" + integrity sha512-IO6zRdpjb8z05jUMf7L4m59PgKO4FktZyxtEDDcsYKATfzeY0jZlTYL2i89yydLIMHPtBffbZG9Vg5Uz0tk5vg== dependencies: change-case "^4.1.2" fs-extra "^10.1.0"