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: add no-auto-close-label #242

Closed
wants to merge 5 commits into from
Closed
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
32 changes: 32 additions & 0 deletions .github/workflows/auto-approve.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: auto-approve
on:
pull_request_target:
types:
- opened
- labeled
- ready_for_review
- reopened
concurrency: ${{ github.workflow }}-${{ github.ref }}
jobs:
approve:
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
if: contains(github.event.pull_request.labels.*.name, 'auto-approve') && github.event.pull_request.draft == false
steps:
- name: Checkout PR
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
ref: ${{ github.event.pull_request.head.ref }}
repository: ${{ github.event.pull_request.head.repo.full_name }}
- name: Auto-approve PRs by other users as team-tf-cdk
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.GH_COMMENT_TOKEN }}
run: gh pr review ${{ github.event.pull_request.number }} --approve
- name: Auto-approve PRs by team-tf-cdk as github-actions[bot]
if: github.event.pull_request.user.login == 'team-tf-cdk'
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: gh pr review ${{ github.event.pull_request.number }} --approve
2 changes: 1 addition & 1 deletion .github/workflows/deploy-cdktf-stacks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
- name: Setup Terraform
uses: hashicorp/setup-terraform@633666f66e0061ca3b725c73b2ec20cd13a8fdd1
with:
terraform_version: 1.6.4
terraform_version: 1.6.5
cli_config_credentials_token: ${{ secrets.TF_CLOUD_TOKEN }}
terraform_wrapper: false

Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ on:
branches:
- main

concurrency: ${{ github.workflow }}-${{ github.ref }}

jobs:
build-shard-matrix:
runs-on: ubuntu-latest
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/diff-cdktf-stacks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
- name: Setup Terraform
uses: hashicorp/setup-terraform@633666f66e0061ca3b725c73b2ec20cd13a8fdd1
with:
terraform_version: 1.6.4
terraform_version: 1.6.5
cli_config_credentials_token: ${{ secrets.TF_CLOUD_TOKEN }}
terraform_wrapper: false

Expand Down
9 changes: 9 additions & 0 deletions lib/repository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,15 @@ export class RepositorySetup extends Construct {
})
);

setOldId(
new IssueLabel(this, `no-auto-close-label`, {
color: "EE2222",
name: "no-auto-close",
repository: repository.name,
provider,
})
);

if (protectMain) {
setOldId(
new BranchProtection(this, "main-protection", {
Expand Down