From da05d72c348a4c468542ef5b4e11b9a66e9e733c Mon Sep 17 00:00:00 2001 From: Yoofi-A-Appiah Date: Tue, 11 Jun 2024 19:08:21 +0000 Subject: [PATCH] ci: using [] in os environ --- slackmessenger.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/slackmessenger.py b/slackmessenger.py index da6c999..9dffa65 100644 --- a/slackmessenger.py +++ b/slackmessenger.py @@ -6,8 +6,8 @@ logging.basicConfig(level=logging.DEBUG) # Initialize the Slack client -client = WebClient(token=os.environ('SLACK_TOKEN')) -timestamp = os.environ('TIMESTAMP') +client = WebClient(token=os.environ["SLACK_TOKEN"]) +timestamp = os.environ["TIMESTAMP"] file_path = f"trivy_report_{timestamp}.json" try: @@ -21,7 +21,7 @@ ) file_url = new_file.get("file").get("permalink") new_message = client.chat_postMessage( - channel=os.environ('SLACK_CHANNEL_ID'), + channel=os.environ["SLACK_CHANNEL_ID"], text=f"Here is the file: {file_url}", ) print("File uploaded and message sent successfully!")