Skip to content

Add dwd_weather (#996) #31

Add dwd_weather (#996)

Add dwd_weather (#996) #31

name: Send URLs from Commit Message as Mastodon
on:
push:
branches:
- main
jobs:
toot:
runs-on: ubuntu-latest
if: "contains(github.event.head_commit.message, 'https')"
steps:
- name: Extract Line with URL as Toot
env:
default_hashtags: " #climate #sustainability #opensource #opensustain"
run: |
echo -e "${{ github.event.head_commit.message }}" >> toot
toot_message="$(cat toot | grep -m 1 https*)"$default_hashtags
echo "toot_message=$toot_message" >> $GITHUB_ENV
URL_git="$(echo $toot_message | grep -o 'https://[a-zA-Z0-9./?=_-]\+')"
echo "URL_git=$URL_git" >> $GITHUB_ENV
- name: Send toot to Mastodon
id: mastodon
uses: cbrgm/mastodon-github-action@v2
with:
access-token: ${{ secrets.MASTODON_ACCESS_TOKEN }} # access token
url: ${{ secrets.MASTODON_URL }} # https://example.social
message: ${{ env.toot_message }}
- name: Send post to Bluesky
id: bluesky_post
uses: myConsciousness/bluesky-post@v5
with:
text: ${{ env.toot_message }}
link-preview-url: ${{ env.URL_git }}
identifier: "opensustaintech.bsky.social"
password: ${{ secrets.BLUESKY_PASSWORD }}