Skip to content

ci: post to mastodon #201

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Jan 22, 2025
Merged
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions .github/workflows/post_to_mastodon.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,20 @@
#!/bin/bash

# Extract version from PR tag passed as environment variable
if [ -z "${PR_TITLE}" ]; then # apparently unset, workflow broken?
if [ -z "${PR_TITLE}" ]; then
echo "Error: 'PR_TITLE' environment variable is not set."
exit 1
fi
version="${PR_TITLE##* }"

# Check if this is a release PR
if [[ ! "${PR_TITLE}" =~ ^chore\(main\):\ release ]]; then
echo "Not a release PR, skipping Mastodon post"
exit 0
fi

# Extract version (everything after "release ")
version="${PR_TITLE#*release }"


# Validate version format
if ! [[ $version =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
Expand Down
Loading