chore(social): post to bluesky using GitHub script

This commit is contained in:
Jan De Dobbeleer 2023-04-26 08:31:07 +02:00 committed by Jan De Dobbeleer
parent be44a3d974
commit b30965aca7

View file

@ -23,19 +23,36 @@ jobs:
notes = notes.replace(/ \(\[[0-9a-z]+\]\(.*\)/g, '') notes = notes.replace(/ \(\[[0-9a-z]+\]\(.*\)/g, '')
notes = notes.trim() notes = notes.trim()
return notes return notes
- name: Sky 🌤️ - name: Bluesky 🌤️
uses: myConsciousness/bluesky-post@f7a428a2fd945074913450c19b11656b766f7c7a id: bluesky
uses: actions/github-script@d7906e4ad0b1822421a7e6a35d5ca353c962f410
with: with:
text: | script: |
📦 ${{ github.event.release.name }} import pkg from '@atproto/api';
const { BskyAgent, RichText } = pkg;
const agent = new BskyAgent({ service: 'https://bsky.social' })
await agent.login({identifier: '${{ secrets.BLUESKY_IDENTIFIER }}', password: '${{ secrets.BLUESKY_PASSWORD }}'})
const postBody = `📦 ${{ github.event.release.name }}
${{steps.notes.outputs.result}} ${{steps.notes.outputs.result}}
${{ github.event.release.html_url }} ${{ github.event.release.html_url }}
#ohmyposh #oss #cli #opensource #ohmyposh #oss #cli #opensource`;
identifier: ${{ secrets.BLUESKY_IDENTIFIER }}
password: ${{ secrets.BLUESKY_PASSWORD }} const rt = new RichText({text: postBody})
await rt.detectFacets(agent)
const post = {
$type: 'app.bsky.feed.post',
text: rt.text,
facets: rt.facets,
createdAt: new Date().toISOString()
}
await agent.post(post)
- name: Toot 🐘 - name: Toot 🐘
uses: cbrgm/mastodon-github-action@d98ab3376f941df14d37d5737961de431c0838c6 uses: cbrgm/mastodon-github-action@d98ab3376f941df14d37d5737961de431c0838c6
with: with: