Skip to content
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
1 change: 0 additions & 1 deletion .gitattributes

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

1 change: 0 additions & 1 deletion .github/dependabot.yml

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

33 changes: 0 additions & 33 deletions .github/workflows/auto-approve.yml

This file was deleted.

1 change: 0 additions & 1 deletion .gitignore

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

1 change: 0 additions & 1 deletion .projen/files.json

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

32 changes: 2 additions & 30 deletions .projenrc.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
from projen.awscdk import AwsCdkPythonApp

from src.bin.cicd_helper import (
GITHUB_ACTIONS,
cdk_validate_workflow,
github_cicd,
pin_github_actions,
Expand Down Expand Up @@ -79,9 +78,6 @@
},
},
},
auto_approve_options={
"allowed_usernames": ["dependabot", "dependabot[bot]"],
},
git_ignore_options={
"ignore_patterns": [
"__pycache__",
Expand Down Expand Up @@ -122,7 +118,7 @@

gh = project.github

# Keep projen-managed workflows (auto-approve, pull-request-lint) on the same action versions
# Keep projen-managed workflows (pull-request-lint) on the same action versions
pin_github_actions(gh)

# Validate the CDK app offline on every pull request (no AWS credentials required)
Expand All @@ -144,7 +140,7 @@
{"dependency-name": "aws-cdk"},
{"dependency-name": "projen"},
],
"labels": ["dependencies", "auto-approve"],
"labels": ["dependencies"],
"groups": {
"default": {
"patterns": ["*"],
Expand All @@ -156,30 +152,6 @@
},
)

# Add auto-merge step to the auto-approve workflow
auto_approve_workflow = project.try_find_object_file(
".github/workflows/auto-approve.yml"
)
if auto_approve_workflow:
auto_approve_workflow.add_override("jobs.approve.permissions.contents", "write")
# Add checkout step before the merge step
auto_approve_workflow.add_override(
"jobs.approve.steps.1",
{
"name": "Checkout",
"uses": GITHUB_ACTIONS["checkout"],
"with": {"persist-credentials": False},
},
)
auto_approve_workflow.add_override(
"jobs.approve.steps.2",
{
"name": "Enable Pull Request Automerge",
"run": 'gh pr merge --merge --auto "${{ github.event.pull_request.number }}"',
"env": {"GH_TOKEN": "${{ secrets.PROJEN_GITHUB_TOKEN }}"},
},
)

# Loop through each environment in target_accounts
for env, account in target_accounts.items():
if account: # Check if account is not None
Expand Down
2 changes: 1 addition & 1 deletion src/bin/cicd_helper.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from projen import github

# Pinned GitHub Actions used by every workflow in this repo. `.projenrc.py` registers these
# with projen's actions provider so projen-managed workflows (auto-approve, pull-request-lint)
# with projen's actions provider so projen-managed workflows (pull-request-lint)
# render the same versions as the workflows built here.
GITHUB_ACTIONS = {
"checkout": "actions/checkout@v7",
Expand Down
Loading