Send Notifications #19
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Send Notifications | |
on: | |
# | |
# Execute the workflow only if build and deploy was successful | |
# By dependency, the workflow should only execute on a push to main | |
# | |
workflow_run: | |
workflows: | |
- "Publish Release" | |
types: | |
- completed | |
env: | |
BLOG_POST_TWITTER_NOTIFICATION_BODY: | |
jobs: | |
twitter_notify: | |
name: Send notification on Twitter | |
runs-on: ubuntu-latest | |
if: contains( join(github.event.commits.*.message), 'New blog post') | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: '3.10' | |
architecture: 'x64' | |
cache: 'pip' | |
- shell: bash | |
run: | | |
python -m pip install -r scripts/requirements.txt | |
python scripts/get_release_info.py | |
- uses: nearform-actions/[email protected] | |
with: | |
twitter-app-key: ${{ secrets.TWITTER_CONSUMER_API_KEY }} | |
twitter-app-secret: ${{ secrets.TWITTER_CONSUMER_API_SECRET }} | |
twitter-access-token: ${{ secrets.TWITTER_ACCESS_TOKEN }} | |
twitter-access-token-secret: ${{ secrets.TWITTER_ACCESS_TOKEN_SECRET }} | |
message: ${{ env.BLOG_POST_TWITTER_NOTIFICATION_BODY}} | |
# TODO: discord notify |