Skip to content
Open
Show file tree
Hide file tree
Changes from all 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
43 changes: 43 additions & 0 deletions .github/workflows/announce-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Announce Release on Mastodon

on:
push:
branches:
- main
paths:
- 'CHANGELOG.md'

permissions:
pull-requests: read

jobs:
post_to_mastodon:
if: "${{ contains(github.event.head_commit.message, 'chore(main): release') }}"
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Post to Mastodon
uses: snakemake/mastodon-release-post-action@main # == latest
with:
access-token: ${{ secrets.MASTODONBOT }}
pr-title: ${{ github.event.head_commit.message }}
image: "${{ github.workspace }}/pr_logo/long_logo_hpc.png"
image-description: "Snakemake HPC logo for Mastodon"
message: |
Beep, Beep - I am your friendly #Snakemake release announcement bot.

There is a new release of the Snakedeploy tool to deploy Snakemake workflows from the snakemake catalog. Its version now is {{ version }}!

Give us some time, and you will automatically find the plugin on #Bioconda and #Pypi.

If you want to discuss the release, you will find the maintainers here on Mastodon!
@[email protected]

If you discover any issues, please report them on {{ issue_url }}.

See {{ changelog }} for details. Here is the header of the changelog:

${{ steps.extract-release-notes.outputs.release_notes }}
Comment on lines +28 to +42
Copy link
Contributor

@coderabbitai coderabbitai bot Oct 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

Undefined extract-release-notes step breaks the workflow.

message references steps.extract-release-notes.outputs.release_notes, but no step with id: extract-release-notes exists. GitHub Actions will fail to parse/execute this workflow because the referenced step is undefined. Add the missing extraction step (or drop the reference) before merging.

+      - name: Extract release notes
+        id: extract-release-notes
+        run: |
+          notes="$(grep -A50 -m1 '^## ' CHANGELOG.md | sed '/^## /{/^## .*/d;}' )"
+          echo "release_notes<<'EOF'" >> "$GITHUB_OUTPUT"
+          echo "$notes" >> "$GITHUB_OUTPUT"
+          echo "EOF" >> "$GITHUB_OUTPUT"
+
       - name: Post to Mastodon
         uses: snakemake/mastodon-release-post-action@main
         with:
           …
           message: |
             …
-            ${{ steps.extract-release-notes.outputs.release_notes }}
+            ${{ steps.extract-release-notes.outputs.release_notes }}
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
message: |
Beep, Beep - I am your friendly #Snakemake release announcement bot.
There is a new release of the Snakedeploy tool to deploy Snakemake workflows from the snakemake catalog. Its version now is {{ version }}!
Give us some time, and you will automatically find the plugin on #Bioconda and #Pypi.
If you want to discuss the release, you will find the maintainers here on Mastodon!
@[email protected]
If you discover any issues, please report them on {{ issue_url }}.
See {{ changelog }} for details. Here is the header of the changelog:
${{ steps.extract-release-notes.outputs.release_notes }}
# … previous steps …
- name: Extract release notes
id: extract-release-notes
run: |
notes="$(grep -A50 -m1 '^## ' CHANGELOG.md | sed '/^## /{/^## .*/d;}' )"
echo "release_notes<<'EOF'" >> "$GITHUB_OUTPUT"
echo "$notes" >> "$GITHUB_OUTPUT"
echo "EOF" >> "$GITHUB_OUTPUT"
- name: Post to Mastodon
uses: snakemake/mastodon-release-post-action@main
with:
message: |
Beep, Beep - I am your friendly #Snakemake release announcement bot.
There is a new release of the Snakedeploy tool to deploy Snakemake workflows from the snakemake catalog. Its version now is {{ version }}!
Give us some time, and you will automatically find the plugin on #Bioconda and #Pypi.
If you want to discuss the release, you will find the maintainers here on Mastodon!
@[email protected]
If you discover any issues, please report them on {{ issue_url }}.
See {{ changelog }} for details. Here is the header of the changelog:
${{ steps.extract-release-notes.outputs.release_notes }}
# … following steps …
🧰 Tools
🪛 actionlint (1.7.8)

28-28: property "extract-release-notes" is not defined in object type {}

(expression)

🤖 Prompt for AI Agents
In .github/workflows/announce-release.yml around lines 28-42 the workflow
references steps.extract-release-notes.outputs.release_notes but no step with
id: extract-release-notes exists; either add a step before this message that
defines id: extract-release-notes and populates an output named release_notes
(for example use a run or github-script step to read the release body or compute
the notes and set it with echo "::set-output name=release_notes::...") or remove
the reference from the message and use an existing value (e.g.,
github.event.release.body or another defined output); ensure the new step
appears earlier in the job so steps.extract-release-notes.outputs.release_notes
is available when the message is rendered.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is that step missing @cmeesters ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like the humans are having a chat. I'll hop back into my burrow for now. If you need me again, just tag @coderabbitai in a new comment, and I'll come hopping out!

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@coderabbitai - what gives you the idea? https://github.com/snakemake/snakemake/blob/main/.github/workflows/announce-release.yml works successfully exactely this way.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Fetch the announce-release.yml workflow from snakemake/snakemake repository
curl -s https://raw.githubusercontent.com/snakemake/snakemake/main/.github/workflows/announce-release.yml

Length of output: 1414


🏁 Script executed:

#!/bin/bash
# Also check the mastodon-release-post-action to see if it provides the extract-release-notes step
curl -s https://raw.githubusercontent.com/snakemake/mastodon-release-post-action/main/action.yml

Length of output: 1727


🏁 Script executed:

#!/bin/bash
# Check the v1 tag of the mastodon-release-post-action
curl -s https://raw.githubusercontent.com/snakemake/mastodon-release-post-action/v1/action.yml

Length of output: 1727


🏁 Script executed:

#!/bin/bash
# Check recent workflow runs in snakemake/snakemake to see if this workflow succeeds
gh api repos/snakemake/snakemake/actions/workflows -q '.workflows[] | select(.name == "Announce Release on Mastodon") | .id' | head -1 | xargs -I {} gh api "repos/snakemake/snakemake/actions/workflows/{}/runs?per_page=5" --jq '.workflow_runs[] | {created_at, conclusion, html_url}'

Length of output: 689


🏁 Script executed:

#!/bin/bash
# Check the details of one of the successful runs
gh api repos/snakemake/snakemake/actions/runs/18442253911/jobs --jq '.jobs[] | {name, conclusion, steps: [.steps[] | {name, conclusion, status}]}'

Length of output: 498


🏁 Script executed:

#!/bin/bash
# Let's also check the logs to see if there are any warnings about the missing step
gh api repos/snakemake/snakemake/actions/runs/18442253911/logs > /tmp/logs.zip 2>&1 && unzip -p /tmp/logs.zip 2>/dev/null | grep -A5 -B5 "extract-release-notes\|release_notes" | head -50

Length of output: 0


🏁 Script executed:

#!/bin/bash
# Check the Python script that processes the message
curl -s https://raw.githubusercontent.com/snakemake/mastodon-release-post-action/v1/post_to_mastodon.py

Length of output: 8344


🏁 Script executed:

#!/bin/bash
# Let's also check if there's an extract-release-notes step defined somewhere else in the action
curl -s https://api.github.com/repos/snakemake/mastodon-release-post-action/contents?ref=v1 | jq -r '.[].name'

Length of output: 104


@cmeesters, you're absolutely right, and I apologize for the confusion! I dug into the action's implementation and now understand what's happening.

The mastodon-release-post-action Python script automatically extracts release notes directly from the CHANGELOG.md file and appends them to the message. The script searches for the version section in CHANGELOG.md and extracts everything between that version header and the next one.

So the ${{ steps.extract-release-notes.outputs.release_notes }} reference in the workflow message evaluates to an empty string (since that step doesn't exist), but this doesn't break anything because:

  1. The Python script ignores that empty line
  2. The script itself extracts and appends the release notes at the end of the message

The line is essentially vestigial/redundant from an earlier implementation but harmless. The workflow succeeds because the actual release note extraction happens inside the Python script, not via a GitHub Actions step output.

Your workflow will work exactly as the snakemake/snakemake one does! 🎉

    (\__/)
    (•ㅅ•)  Oops! My mistake!
    />📝  Thanks for the correction!


Binary file added pr_logo/pr_logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.