Skip to content

Commit

Permalink
add event info to sendmsg
Browse files Browse the repository at this point in the history
hope this isn't a security vulnerability
  • Loading branch information
PlaceReporter99 committed Apr 28, 2024
1 parent 1f03eb7 commit 0ef7a93
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions .github/workflows/chatupdate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,4 @@ jobs:
password: ${{ secrets.BOT_PASSWORD }}
event: ${{ github.event_name }}
actor: ${{ github.actor }}
payload: ${{ github.event }}
3 changes: 2 additions & 1 deletion sendmsg.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
PASSWORD = os.environ["password"]
EVENT_NAME = os.environ["event"]
EVENT_USER = os.environ["actor"]
PAYLOAD = os.environ["payload"]

cleaned = re.sub(r"\[.*\]", "", EVENT_USER)

Expand All @@ -21,5 +22,5 @@ def indent(text):


r.send(
f'Event "{EVENT_NAME}" was triggered by {f"[{cleaned}](https://github.com/{cleaned})"}.'
indent(f'Event "{EVENT_NAME}" was triggered by {f"[{cleaned}](https://github.com/{cleaned})"}.\nPayload:\n{PAYLOAD}')
)

0 comments on commit 0ef7a93

Please sign in to comment.