From 5b51706b7ab0771e76e211c1f66ee673f4e157cb Mon Sep 17 00:00:00 2001 From: Jan De Dobbeleer Date: Wed, 26 Apr 2023 16:37:07 +0200 Subject: [PATCH] chore(social): add card instead of link --- .github/workflows/social.yml | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/.github/workflows/social.yml b/.github/workflows/social.yml index fa3639a4..6fabe03d 100644 --- a/.github/workflows/social.yml +++ b/.github/workflows/social.yml @@ -29,30 +29,31 @@ jobs: with: script: | import pkg from '@atproto/api'; - const { BskyAgent, RichText } = pkg; + const { BskyAgent } = 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 }} + const version = '${{ github.event.release.name }}'; + const notes = `${{steps.notes.outputs.result}}`; - ${{steps.notes.outputs.result}} + const text = `📦 ${version} - ${{ github.event.release.html_url }} + ${notes} #ohmyposh #oss #cli #opensource`; - 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) + await agent.post({ + text: text, + embed: { + $type: 'app.bsky.embed.external', + external: { + uri: `https://github.com/JanDeDobbeleer/oh-my-posh/releases/tag/${version}`, + title: "GitHub release", + description: version, + }, + }, + }); - name: Toot 🐘 uses: cbrgm/mastodon-github-action@d98ab3376f941df14d37d5737961de431c0838c6 with: