https://github.com/mod-posh/post2bluesky
A simple GitHub Workflow to send a notification to the BlueSky social media platform
https://github.com/mod-posh/post2bluesky
github-actions powershell
Last synced: 8 days ago
JSON representation
A simple GitHub Workflow to send a notification to the BlueSky social media platform
- Host: GitHub
- URL: https://github.com/mod-posh/post2bluesky
- Owner: mod-posh
- License: gpl-3.0
- Created: 2024-01-08T19:13:54.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2025-01-21T17:50:10.000Z (about 1 year ago)
- Last Synced: 2025-01-21T18:31:03.712Z (about 1 year ago)
- Topics: github-actions, powershell
- Language: PowerShell
- Homepage:
- Size: 62.5 KB
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# BlueSky Notification GitHub Action
## Overview
The "Post2Bluesky" Github Action posts a message to your Bsky social account. You can use this for project update notifications, new releases, or just an easy way to post a message. The workflow accepts a plain-text message or a JSON string comprised of at least [bsky record](https://atproto.com/blog/create-post#post-record-structure).
## Setup
**GitHub Secrets**: Set up the following secrets in your GitHub repository:
- `bluesky_api_key`: Your BlueSky App Password.
- `bluesky_identifier`: Your BlueSky Identifier, like `user.bsky.social`.
## Workflow File
You can trigger the `action.yml` by `workflow_call` to post a notification automatically. The workflow contains several steps to act:
1. Checkout the repository
2. Call the `post2bsky.ps1` script
### Workflow Inputs
- `Message`: The message to post, for links use github [markdown](https://docs.github.com/en/get-started/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax#links)
- `verbose`: A value of verbose will output additional information
- `bluesky_api_key`: Your BlueSky App Password
- `bluesky_identifier`: Your BlueSky Identifier, something like user.bsky.social
## PowerShell Script (`post2bsky.ps1`)
The PowerShell script constructs an authentication package to authenticate into the API. Once it has authenticated, it checks to see if the `Message` is a proper bsky record with repo or if it's a plain-text message. If it's a proper message it is posted; if it's missing a repo, one is constructed, and then the message is posted; and finally, if it's just a plain-text message, a record and repo are created and posted for you.
## Usage
There a few different ways you could use this action, here is an example of one way to get you started.
```yaml
jobs:
send_notification:
uses: mod-posh/Post2BlueSky@v0.0.3.0
with:
message: '"This is a test post with a link to [github](https://www.github.com)"'
verbose: 'verbose'
bluesky_api_key: ${{ secrets.bluesky_api_key }}
bluesky_identifier: ${{ secrets.bluesky_identifier }}
```
> [!Note]
> This example is used directly as part of a larger workflow
> The verbose option will output a little more detail in the logs
## License
This project is licensed using the [Gnu GPL-3](LICENSE).