Skip to content

Commit d0fb3cd

Browse files
authored
fix: path to posting script (#193)
<!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **Chores** - Updated GitHub Actions workflow to use the pull request title for posting to Mastodon. - Made the Mastodon post script executable. - Added validation for the pull request title in the posting script. - Improved version extraction logic for enhanced flexibility in input formats. - Revised announcement message for clarity and consistency. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
1 parent d7dcbbb commit d0fb3cd

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

.github/workflows/post_to_mastodon.sh

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
#!/bin/bash
22

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

610
# Validate version format
711
if ! [[ $version =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
@@ -15,15 +19,14 @@ changelog="https://github.com/snakemake/snakemake-executor-plugin-slurm/releases
1519
# Maximum character limit for Mastodon posts (on Fediscience: 1500 characters)
1620
MAX_TOOT_LENGTH=1500
1721

18-
1922
read -d '\n' message << EndOfText
20-
Beep, Beep - I am your friendly #Snakemake release announcement bot
23+
Beep, Beep - I am your friendly #Snakemake release announcement bot.
2124
2225
There is a new release of the Snakemake executor for #SLURM on #HPC systems. Its version is '${version}'!
2326
2427
See ${changelog//\'/\\\'} for details.
2528
26-
Give us some time and you will automatically find it on #Bioconda and #Pypi.
29+
Give us some time and you will automatically find the plugin on #Bioconda and #Pypi.
2730
2831
If you want to discuss the release you will find the maintainers here on Mastodon!
2932
@rupdecat@fediscience.org and @johanneskoester@fosstodon.org

.github/workflows/post_to_mastodon.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,6 @@ jobs:
2323
max_attempts: 3
2424
command: |
2525
export MASTODONBOT="${{ secrets.MASTODONBOT }}"
26-
export PR_TITLE="${{ github.event.release.tag_name }}"
26+
export PR_TITLE="${{ github.event.pull_request.title }}"
27+
chmod +x $GITHUB_WORKSPACE/.github/workflows/post_to_mastodon.sh
2728
$GITHUB_WORKSPACE/.github/workflows/post_to_mastodon.sh

0 commit comments

Comments
 (0)