Skip to content

Commit

Permalink
Merge pull request #61 from Terre8055/anotherdevelop
Browse files Browse the repository at this point in the history
ci: using [] in os environ
  • Loading branch information
Yoofi-A-Appiah authored Jun 11, 2024
2 parents 0221093 + da05d72 commit c0957a8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions slackmessenger.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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!")
Expand Down

0 comments on commit c0957a8

Please sign in to comment.