Skip to content

Commit

Permalink
feat: experimenting with automated release post to Mastodon (#166)
Browse files Browse the repository at this point in the history
see title

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

- **New Features**
- Introduced an automated workflow to post updates to Mastodon when a
pull request is merged into the main branch.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
  • Loading branch information
cmeesters and coderabbitai[bot] authored Nov 8, 2024
1 parent a10d7d7 commit c06325d
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/post_to_mastodon.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Post to Mastodon on PR Merge

on:
pull_request:
branches:
- main
types:
- closed

permissions:
pull-requests: read

jobs:
post_to_mastodon:
if: github.event.pull_request.merged == true
runs-on: ubuntu-latest
steps:
- name: Post to Mastodon
uses: nick-fields/retry@v2
with:
timeout_minutes: 2
max_attempts: 3
command: |
curl -X POST -H "Authorization: Bearer ${{ secrets.MASTODON_ACCESS_TOKEN }}" \
-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." \
https://fediscience.org/api/v1/statuses \
-w "\nResponse code: %{http_code}\n" \
-f || {
echo "Failed to post to Mastodon"
exit 1
}

0 comments on commit c06325d

Please sign in to comment.