Skip to content

Commit

Permalink
Send Slack notification on releases (#151)
Browse files Browse the repository at this point in the history
  • Loading branch information
epwalsh authored Jan 29, 2025
1 parent 1ef7851 commit 907b9c5
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -259,3 +259,7 @@ jobs:
GH_TOKEN: ${{ github.token }}
run: |
./src/scripts/release/add_pr_comments_on_release.sh
- name: Send Slack notifications about release
run: |
python ./src/scripts/release/slack_notification.py '${{ secrets.SLACK_WEBHOOK_URL}}'
26 changes: 26 additions & 0 deletions src/scripts/release/slack_notification.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import argparse

import requests

from olmo_core.version import VERSION


def parse_args() -> argparse.Namespace:
parser = argparse.ArgumentParser(
"slack-notifier", description="Send a release notifcation to a Slack channel."
)
parser.add_argument("webhook_url", type=str, help="The webhook URL for a Slack channel.")
return parser.parse_args()


def main():
args = parse_args()
text = (
f"OLMo-core *v{VERSION}* is now out. See "
f"https://github.com/allenai/OLMo-core/releases/tag/v{VERSION} for release notes."
)
requests.post(args.webhook_url, json={"text": text})


if __name__ == "__main__":
main()

0 comments on commit 907b9c5

Please sign in to comment.