-
-
Notifications
You must be signed in to change notification settings - Fork 8
50 lines (43 loc) · 1.66 KB
/
post.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
name: Post
on:
release:
types: [published]
workflow_dispatch:
inputs:
message:
description: "Message to post. Can be ordinar string or json-value \"Multiline\nstring.\"."
required: false
workflow_call:
inputs:
message:
type: string
description: "Message to post. Can be ordinar string or json-value \"Multiline\nstring.\"."
required: false
jobs:
post:
name: Post
runs-on: ubuntu-latest
steps:
- name: Repo Url
id: url
run: |
URL="${{ github.event_name == 'release' && github.event.release.html_url || format('{0}/{1}', github.server_url, github.repository) }}"
echo "value=$URL" >> "$GITHUB_OUTPUT"
- name: Prepare Words
id: words
env:
XRELEASE: ${{ github.event_name == 'release' && (github.event.release.prerelease && 'pre-release' || 'release') || '' }}
run: echo "release=$XRELEASE" >> "$GITHUB_OUTPUT"
- name: Toot
id: mastodon
uses: cbrgm/[email protected]
with:
message: |
🎉 Rusty Playdate Update!
${{ ((inputs.message && startsWith(inputs.message, '"') && endsWith(inputs.message, '"')) && fromJson(inputs.message) || inputs.message) || (github.event_name == 'release' && format('New {0} published: {1}', steps.words.outputs.release, github.event.release.name) || '') }}
${{ steps.url.outputs.value }}
#RustLang #Rust #Playdate
language: "en"
visibility: public # use `private` for tests
url: ${{ secrets.MASTODON_URL }}
access-token: ${{ secrets.MASTODON_ACCESS_TOKEN }}