Skip to content

ci: mastodon action #231

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 10 commits into from
Mar 12, 2025
33 changes: 33 additions & 0 deletions .github/workflows/announce-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Announce Release on Mastodon

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

permissions:
pull-requests: read

jobs:
post_to_mastodon:
if: contains(github.event.pull_request.title, 'chore(main): release')
Copy link
Contributor

Choose a reason for hiding this comment

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

💡 Verification agent

❓ Verification inconclusive

YAML Parsing Issue in Condition & Event Context Mismatch
The if: condition on line 15 is causing a YAML parsing error because the expression contains a colon (in 'chore(main): release') which must be quoted. Moreover, the workflow is triggered by a push event where the property github.event.pull_request.title is not available. If the intent is to restrict announcements to release merges, consider checking the commit message (e.g., using github.event.head_commit.message) instead.

Example fix:

-    if: contains(github.event.pull_request.title, 'chore(main): release')
+    if: "contains(github.event.head_commit.message, 'chore(main): release')"

Alternatively, if you truly need to evaluate the pull request title, you might need to change the triggering event (for example, to pull_request) instead of push. Please verify the intended workflow context.


Critical YAML & Event Context Issue: Update if: Condition
The current condition causes a YAML parsing error due to the unquoted expression containing a colon, and it incorrectly references github.event.pull_request.title even though the workflow is triggered by a push event (where pull request data isn’t available). To fix this:

  • Wrap the entire expression in double quotes.
  • Change the event property to one available on push events—use github.event.head_commit.message instead.

For example, update line 15 as follows:

-    if: contains(github.event.pull_request.title, 'chore(main): release')
+    if: "contains(github.event.head_commit.message, 'chore(main): release')"

If using the pull request title is essential, then consider switching the workflow trigger to the pull_request event instead.

📝 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
if: contains(github.event.pull_request.title, 'chore(main): release')
if: "contains(github.event.head_commit.message, 'chore(main): release')"
🧰 Tools
🪛 actionlint (1.7.4)

15-15: could not parse as YAML: yaml: line 15: mapping values are not allowed in this context

(syntax-check)

🪛 YAMLlint (1.35.1)

[error] 15-15: syntax error: mapping values are not allowed here

(syntax)

runs-on: ubuntu-latest
steps:
- name: Post to Mastodon
uses: snakemake/mastodon-release-post-action@v1
with:
message: |
Beep, Beep - I am your friendly #Snakemake release announcement bot.

There is a new release of the Snakemake executor for #SLURM on #HPC systems. Its version is {{ version }}!

See {{ changelog }} for details.

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!
@rupdecat and @johanneskoester

If you find any issues, please report them on {{ issue_url }}
79 changes: 0 additions & 79 deletions .github/workflows/post_to_mastodon.sh

This file was deleted.

30 changes: 0 additions & 30 deletions .github/workflows/post_to_mastodon.yml

This file was deleted.