diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 71b2da9..f82323a 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -46,17 +46,18 @@ jobs:
lint-python:
runs-on: ubuntu-latest
steps:
+ - uses: actions/checkout@v4
+
- name: Setup python
- uses: actions/setup-python@v2
+ uses: actions/setup-python@v5
with:
- python-version: 3.8
+ python-version: 3.12
- name: Install dependencies
- run: pip install --pre flake8==4.0.1 black==22.3.0
+ run: pip install ruff
- - uses: actions/checkout@v4
- - run: flake8
- - run: black --check .
+ - run: ruff check .
+ - run: ruff format --check .
test-python:
runs-on: ubuntu-latest
@@ -71,13 +72,13 @@ jobs:
- name: Setup python
uses: actions/setup-python@v2
with:
- python-version: 3.8
+ python-version: 3.12
# Keep boto version in sync with what is installed inside of the Python
- # 3.8 lambda. See the link below for reference.
+ # 3.12 lambda. See the link below for reference.
# https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html
- name: Install dependencies
- run: pip install boto3==1.20.32 botocore==1.23.32
+ run: pip install boto3==1.34.95
- uses: actions/checkout@v4
- run: python -m tests
diff --git a/README.md b/README.md
index 254c37c..918c6ee 100644
--- a/README.md
+++ b/README.md
@@ -55,7 +55,7 @@ module "codepipeline_notifications" {
| [label\_key\_case](#input\_label\_key\_case) | The letter case of label keys (`tag` names) (i.e. `name`, `namespace`, `environment`, `stage`, `attributes`) to use in `tags`.
Possible values: `lower`, `title`, `upper`.
Default value: `title`. | `string` | `null` | no |
| [label\_order](#input\_label\_order) | The naming order of the id output and Name tag.
Defaults to ["namespace", "environment", "stage", "name", "attributes"].
You can omit any of the 5 elements, but at least one must be present. | `list(string)` | `null` | no |
| [label\_value\_case](#input\_label\_value\_case) | The letter case of output label values (also used in `tags` and `id`).
Possible values: `lower`, `title`, `upper` and `none` (no transformation).
Default value: `lower`. | `string` | `null` | no |
-| [lambda\_runtime](#input\_lambda\_runtime) | The runtime to use for the lambda function | `string` | `"python3.8"` | no |
+| [lambda\_runtime](#input\_lambda\_runtime) | The runtime to use for the lambda function | `string` | `"python3.12"` | no |
| [name](#input\_name) | Solution name, e.g. 'app' or 'jenkins' | `string` | `null` | no |
| [namespace](#input\_namespace) | Namespace, which could be your organization name or abbreviation, e.g. 'eg' or 'cp' | `string` | `null` | no |
| [pipeline\_event\_type\_ids](#input\_pipeline\_event\_type\_ids) | The list of pipeline events to trigger a notification on | `list(string)` |
[| no | diff --git a/lambdas/notifier/notifier.py b/lambdas/notifier/notifier.py index a7f6713..c73ed18 100644 --- a/lambdas/notifier/notifier.py +++ b/lambdas/notifier/notifier.py @@ -1,7 +1,6 @@ import json import logging import os -import typing as t import urllib import urllib.request @@ -39,8 +38,8 @@ def format_slack_attachment( environment: str, region: str, action: str, - revision_summary: t.Optional[str], - revision_url: t.Optional[str], + revision_summary: str | None, + revision_url: str | None, ) -> dict: execution_link = ( f"
"started",
"failed",
"canceled",
"resumed",
"succeeded",
"superseded"
]