| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
Use this action to send a toot (message) from a GitHub actions workflow to Mastodon.
This action can be executed independently from workflows within a container. To do so, use the following command:
podman run --rm -it ghcr.io/cbrgm/mastodon-github-action:v2 --help
First, open /settings/applications/new of your instance on your browser and create new application. Once the application is created set the following repository secrets
Use the following step in your GitHub Actions Workflow:
- name: Send toot to Mastodon
id: mastodon
uses: cbrgm/mastodon-github-action@v2
with:
access-token: ${{ secrets.MASTODON_ACCESS_TOKEN }} # access token
url: ${{ secrets.MASTODON_URL }} # https://example.social
message: "Hello from GitHub Actions!"
Advanced usage:
- name: Send toot to Mastodon with additional options
id: mastodon_toot
uses: cbrgm/mastodon-github-action@v2
with:
access-token: ${{ secrets.MASTODON_ACCESS_TOKEN }} # Mastodon access token for authentication.
url: ${{ secrets.MASTODON_URL }} # Mastodon instance URL, e.g., https://example.social.
message: "Hello from GitHub Actions! Check out our latest update." # The content of the toot.
visibility: "unlisted" # Make the toot unlisted to avoid spamming public timelines.
sensitive: "true" # Mark the toot as sensitive.
spoiler-text: "Latest Update" # Provide a content warning for the actual message.
language: "en" # ISO 639 language code for the toot.
scheduled-at: "2024-01-01T00:00:00Z" # Schedule the toot for a future date/time.
# Example on how to use outputs from the Mastodon action step.
- name: Get toot information
run: |
echo "Toot ID: ${{ steps.mastodon_toot.outputs.id }}"
echo "Toot URL: ${{ steps.mastodon_toot.outputs.url }}"
echo "Scheduled at: ${{ steps.mastodon_toot.outputs.scheduled_at }}"Attach a single image with alt text:
- name: Send toot with image
uses: cbrgm/mastodon-github-action@v2
with:
access-token: ${{ secrets.MASTODON_ACCESS_TOKEN }}
url: ${{ secrets.MASTODON_URL }}
message: "Check out this screenshot!"
media-paths: "screenshot.png"
media-descriptions: "A screenshot of the new dashboard"Attach multiple images (up to 4):
- name: Send toot with multiple images
uses: cbrgm/mastodon-github-action@v2
with:
access-token: ${{ secrets.MASTODON_ACCESS_TOKEN }}
url: ${{ secrets.MASTODON_URL }}
message: "Latest photos from the event"
media-paths: "photos/img1.jpg, photos/img2.jpg, photos/img3.jpg"
media-descriptions: "First image description, Second image description, Third image description"Post media without text (media-only toot):
- name: Send media-only toot
uses: cbrgm/mastodon-github-action@v2
with:
access-token: ${{ secrets.MASTODON_ACCESS_TOKEN }}
url: ${{ secrets.MASTODON_URL }}
media-paths: "artifact.png"
media-descriptions: "Build artifact from CI"You can find more usage examples in the ./example-workflows subfolder.
| Back | FazBrowse Home | New Git URL |