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
51 changes: 51 additions & 0 deletions .github/workflows/announce-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
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: Verify logo file exists
run: |
ls -la ${{ github.workspace }}/pr_logo/
if [ ! -f "${{ github.workspace }}/pr_logo/long_logo_env_modules.png" ]; then
echo "ERROR: Logo file not found!"
exit 1
fi
echo "Logo file found at: ${{ github.workspace }}/pr_logo/long_logo_env_modules.png"

- name: Post to Mastodon
uses: snakemake/mastodon-release-post-action@main # == latest

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Check available tags/releases for the mastodon-release-post-action
gh api repos/snakemake/mastodon-release-post-action/tags --jq '.[].name' 2>/dev/null || echo "No tags found or repo not accessible via gh CLI"
gh api repos/snakemake/mastodon-release-post-action/releases --jq '.[].tag_name' 2>/dev/null || echo "No releases found or repo not accessible via gh CLI"

Repository: snakemake/snakemake-software-deployment-plugin-envmodules

Length of output: 424


🌐 Web query:

snakemake mastodon-release-post-action releases versions github

💡 Result:

In the snakemake/snakemake repository there is a GitHub Actions workflow named “Announce Release on Mastodon”, which is intended to post to Mastodon when a GitHub Release is made/published. [1]

To figure out which mastodon-release-post-action repo and which versions/tags it uses:

  1. Open the workflow definition YAML for that workflow in the Snakemake repo (the file under .github/workflows/ corresponding to “Announce Release on Mastodon”).
  2. In that YAML, find the step like uses: <owner>/mastodon-release-post-action@....
    • The part after @ is the version selector (typically a tag like v1 or a full tag like v1.2.3).
  3. Go to that action’s GitHub repo Releases/Tags page and confirm what the referenced tag points to (best practice is pinning to a major tag like @v1 so you get non-breaking updates).

Separately, Snakemake itself is actively released (e.g., the repo shows v9.16.3 as a “Latest” release on Feb 5, 2026), which is the kind of event that workflow is meant to announce. [2]

Sources: [1] [2]


🏁 Script executed:

#!/bin/bash
# Try using curl to access GitHub API without authentication for public repos
# Check releases and tags for the mastodon-release-post-action
echo "=== Checking releases via public API ==="
curl -s https://api.github.com/repos/snakemake/mastodon-release-post-action/releases | jq -r '.[].tag_name' | head -20

echo ""
echo "=== Checking tags via public API ==="
curl -s https://api.github.com/repos/snakemake/mastodon-release-post-action/tags | jq -r '.[].name' | head -20

echo ""
echo "=== Checking repo info ==="
curl -s https://api.github.com/repos/snakemake/mastodon-release-post-action | jq '{name, description, default_branch, has_releases}'

Repository: snakemake/snakemake-software-deployment-plugin-envmodules

Length of output: 569


🌐 Web query:

site:github.com snakemake/mastodon-release-post-action releases tags

💡 Result:

  • The repo snakemake/mastodon-release-post-action has 24 GitHub releases; the latest release is v1.7.6 (Nov 30, 2025). [1]
  • Its tags include version tags like v1.7.6, plus moving major/minor tags v1 and v1.7 (both dated Nov 30, 2025 and pointing at the same commit as v1.7.6). [2]

Pin action to a specific version.

Using @main for actions is a security and reliability risk—the action code could change unexpectedly or be compromised. The snakemake/mastodon-release-post-action has multiple stable releases available. Pin to a specific version tag instead (e.g., @v1.7.6 for the latest release, or @v1.7 for receiving patch updates within the minor version).

Example fix
-        uses: snakemake/mastodon-release-post-action@main # == latest
+        uses: snakemake/mastodon-release-post-action@v1.7.6
📝 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
uses: snakemake/mastodon-release-post-action@main # == latest
uses: snakemake/mastodon-release-post-action@v1.7.6
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/announce-release.yml at line 31, Replace the unpinned
GitHub Action reference to snakemake/mastodon-release-post-action@main with a
pinned release tag to avoid accidental or malicious changes; edit the workflow
step that currently uses "snakemake/mastodon-release-post-action@main" and
change it to a specific version such as
"snakemake/mastodon-release-post-action@v1.7.6" (or use the minor-series pin
"snakemake/mastodon-release-post-action@v1.7" if you want automatic patch
updates) so the action code is stable and auditable.

with:
access-token: ${{ secrets.MASTODONBOT }}
pr-title: ${{ github.event.head_commit.message }}
image: "long_logo_conda.png"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

Image filename mismatch.

Line 24 verifies long_logo_env_modules.png exists, but this line references long_logo_conda.png. The workflow will verify one file and then attempt to use a different file that may not exist.

🐛 Proposed fix
-          image: "long_logo_conda.png"
+          image: "pr_logo/long_logo_env_modules.png"
📝 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
image: "long_logo_conda.png"
image: "pr_logo/long_logo_env_modules.png"
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/announce-release.yml at line 35, The workflow references a
mismatched image name: the verification step checks for
"long_logo_env_modules.png" but the usage line sets image:
"long_logo_conda.png"; update the usage to image: "long_logo_env_modules.png"
(or alternatively change the verification to check for "long_logo_conda.png") so
the filename used by the image key matches the file validated earlier.

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 Snakemake software deployment plugin for #EnvironmentModules for #HPC. 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 maintainer here on Mastodon! @johanneskoester@fosstodon.org

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 }}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

Missing step extract-release-notes.

This references steps.extract-release-notes.outputs.release_notes, but no step with id: extract-release-notes is defined in the workflow. This will result in an empty value being interpolated.

You need to add a step that extracts release notes before the "Post to Mastodon" step, for example using an action like stefanzweifel/changelog-parser-action or a custom script.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/announce-release.yml at line 50, Add a new workflow step
with id "extract-release-notes" before the "Post to Mastodon" step to populate
steps.extract-release-notes.outputs.release_notes; implement it using a
changelog parser action (e.g., stefanzweifel/changelog-parser-action) or a small
script that reads your changelog/release body and sets the output
"release_notes", then reference that output in the existing Post to Mastodon
step so steps.extract-release-notes.outputs.release_notes is defined.


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