Skip to content

1.0.9

1.0.9 #14

name: Release-Mastodon
on:
workflow_call:
secrets:
MASTODON_URL:
required: true
MASTODON_ACCESS_TOKEN:
required: true
release:
types:
- published
jobs:
notify:
name: Mastodon
runs-on: ubuntu-latest
steps:
- name: Trim Body
env:
RELEASE_BODY: ${{ toJSON(github.event.release.body) }}
shell: bash
run: |
body="$RELEASE_BODY"
body="${body#\"}"
body="${body%\"}"
result="${body:0:350}"
echo "BODY=${result}" >> $GITHUB_ENV
- name: Send toot to Mastodon
continue-on-error: true
id: mastodon
uses: cbrgm/mastodon-github-action@v1
env:
REPOSITORY: ${{ github.repository }}
REPOSITORY_URL: ${{ github.repository.html_url }}
REF: ${{ github.ref_name }}
BODY: ${{ github.env.BODY }}
LINK: ${{ github.event.release.html_url }}
TITLE: ${{ github.event.release.name }}
REPO_URL: ${{ github.event.release.repository.html_url }}
REPO_NAME: ${{ github.event.release.repository.full_name }}
MASTODON_URL: ${{ secrets.MASTODON_URL }}
MASTODON_ACCESS_TOKEN: ${{ secrets.MASTODON_ACCESS_TOKEN }}
with:
message: |
${{ env.REPOSITORY }} released a new version.
${{ env.TITLE }} is out now!
${{ env.BODY }}
${{ env.LINK }}
${{ env.REPO_URL }}
visibility: "public"