Skip to content

Commit 32dbef3

Browse files
committed
feat: splitted the code of the yaml file and the script part for the mastodon bot
1 parent da8e6ba commit 32dbef3

File tree

2 files changed

+28
-9
lines changed

2 files changed

+28
-9
lines changed

.github/workflows/post_to_mastodon.sh

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#!bin/bash
2+
3+
version="${${{ github.event.pull_request.title }}##* }"
4+
changelog="https://github.com/snakemake/snakemake-executor-plugin-slurm/releases/tag/v${version}"
5+
6+
read -d '\n' message << EndOfText
7+
Beep, Beepi - I am the #Snakemake release bot
8+
9+
I have a new release in for the Snakemake executor for #SLURM on #HPC systems. The version now is '${version}'.
10+
11+
See ${changelog} for details.
12+
13+
Get the latest release from #Bioconda or #Pypi. Be sure to give it some time to be released there, too.
14+
15+
#OpenScience #ReproducibleResearch #ReproducibleComputing
16+
17+
EndOfText
18+
19+
curl -X POST -H "Authorization: Bearer ${{ secrets.MASTODONBOT }}" \
20+
-F "status=${message}" \
21+
https://fediscience.org/api/v1/statuses \
22+
-w "\nResponse code: %{http_code}\n" \
23+
-f || {
24+
echo "Failed to post to Mastodon"
25+
exit 1
26+
}

.github/workflows/post_to_mastodon.yml

+2-9
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,5 @@ jobs:
2020
with:
2121
timeout_minutes: 2
2222
max_attempts: 3
23-
command: |
24-
curl -X POST -H "Authorization: Bearer ${{ secrets.MASTODONBOT }}" \
25-
-F "status=New release in Snakemake project '${{ github.event.repository.full_name }}' for pull request '#${{ github.event.pull_request.number }}' merged: '${{ github.event.pull_request.title }}'. Get the latest release from #Bioconda or #Pypi." \
26-
https://fediscience.org/api/v1/statuses \
27-
-w "\nResponse code: %{http_code}\n" \
28-
-f || {
29-
echo "Failed to post to Mastodon"
30-
exit 1
31-
}
23+
run: |
24+
./post_to_mastodon.sh

0 commit comments

Comments
 (0)