2
2
import boto3
3
3
import requests
4
4
import os
5
- import re
6
5
7
6
secretsmanager = boto3 .client ('secretsmanager' )
8
7
TOKEN_SECRET_NAME = os .environ ['FLUX2_WEBHOOK_TOKEN_SECRET_NAME' ]
@@ -55,8 +54,7 @@ def make_requests(webhook_url, repository, headers):
55
54
'repository' : repository
56
55
}))
57
56
58
-
59
- def call_flux_webhook (repository , image_tag ):
57
+ def call_flux_webhook (repository ):
60
58
# Retrieve the map of values from Secrets Manager
61
59
webhook_map = get_webhook_map ()
62
60
@@ -67,11 +65,11 @@ def call_flux_webhook(repository, image_tag):
67
65
repo_data = webhook_map [repository ]
68
66
webhook_urls = repo_data .get ('webhook' )
69
67
token = repo_data .get ('token' , get_global_token ())
70
- regex = repo_data .get ('regex' , '.*' )
71
68
for webhook in webhook_urls :
72
69
headers = {'Authorization' : f'Bearer { token } ' }
73
- if regex and re .match (regex , image_tag ): # Verificar si el tag cumple con la expresión regular
74
- make_requests (webhook , repository , headers )
70
+ make_requests (webhook , repository , headers )
71
+
72
+
75
73
76
74
77
75
def lambda_handler (event , context ):
@@ -84,7 +82,7 @@ def lambda_handler(event, context):
84
82
process_ecr_push_event (detail )
85
83
86
84
# Call the Flux webhook with the event repository
87
- call_flux_webhook (detail ['repository-name' ], detail [ 'image-tag' ] )
85
+ call_flux_webhook (detail ['repository-name' ])
88
86
89
87
return {
90
88
'statusCode' : 200 ,
0 commit comments