Skip to content

Commit

Permalink
check facets
Browse files Browse the repository at this point in the history
  • Loading branch information
drmowinckels committed Nov 3, 2024
1 parent 686c5b5 commit bc5cf0c
Showing 1 changed file with 34 additions and 28 deletions.
62 changes: 34 additions & 28 deletions .github/workflows/build-site.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -228,34 +228,6 @@ jobs:
random_emoji=${emojis[$RANDOM % ${#emojis[@]}]}
echo "EMOJI=${random_emoji}" >> $GITHUB_ENV
- name: 🦣 Toot it! 🦣
env:
MASTODON_INSTANCE: fosstodon.org
run: |
# Compose message
message="πŸ“ New blog post πŸ“
\n\n'${{ env.TITLE }}'
\n\n$${{ env.EMOJI }} ${{ env.SUMMARY }}
\n\nπŸ‘€ Read more at ${{ env.URL }}
\n\n${{ env.TAGS }}"
# First, upload the media and get the media ID
MEDIA_ID=$(curl -X POST \
-H "Authorization: Bearer ${{ secrets.MASTO_KEY }}" \
-F "file=@./${{ env.IMAGE }}" \
https://${MASTODON_INSTANCE}/api/v1/media | jq -r '.id')
# Then, create a new status with the media attached
toot=$(curl -X POST \
-H "Authorization: Bearer ${{ secrets.MASTO_KEY }}" \
-F "status=${{ env.MESSAGE }}" \
-F "media_ids[]=${MEDIA_ID}" \
https://${MASTODON_INSTANCE}/api/v1/statuses | jq -r '.id')
# Display clickable url
echo "🦣 Tooted! 🦣"
echo "https://${MASTODON_INSTANCE}/web/statuses/${toot}"
- name: πŸ¦‹ Skeet it πŸ¦‹
env:
image: ${{ env.IMAGE }}
Expand Down Expand Up @@ -305,6 +277,7 @@ jobs:
"uri": $uri
}]
}]')
echo $facets
tags=$(echo -n "$message" | grep -o -E '#[a-zA-Z0-9_]+' | uniq)
Expand All @@ -324,6 +297,8 @@ jobs:
facets=$(echo "$facets" | jq --argjson facet "$tag_facet" '. + [$facet]')
done
echo $facet
# Preparing the JSON payload
json_payload=$(jq -n \
--arg repo "${DID}" \
Expand All @@ -350,6 +325,8 @@ jobs:
}
}')
echo $json_payload
# Post it
post_resp=$(curl -s \
https://bsky.social/xrpc/com.atproto.repo.createRecord \
Expand All @@ -362,6 +339,35 @@ jobs:
echo "πŸ¦‹ Skeet it! πŸ¦‹"
echo "https://bsky.app/profile/${handle}/post/${bid}"
- name: 🦣 Toot it! 🦣
env:
MASTODON_INSTANCE: fosstodon.org
run: |
# Compose message
message="πŸ“ New blog post πŸ“
\n\n'${{ env.TITLE }}'
\n\n$${{ env.EMOJI }} ${{ env.SUMMARY }}
\n\nπŸ‘€ Read more at ${{ env.URL }}
\n\n${{ env.TAGS }}"
# First, upload the media and get the media ID
MEDIA_ID=$(curl -X POST \
-H "Authorization: Bearer ${{ secrets.MASTO_KEY }}" \
-F "file=@./${{ env.IMAGE }}" \
https://${MASTODON_INSTANCE}/api/v1/media | jq -r '.id')
# Then, create a new status with the media attached
toot=$(curl -X POST \
-H "Authorization: Bearer ${{ secrets.MASTO_KEY }}" \
-F "status=${{ env.MESSAGE }}" \
-F "media_ids[]=${MEDIA_ID}" \
https://${MASTODON_INSTANCE}/api/v1/statuses | jq -r '.id')
# Display clickable url
echo "🦣 Tooted! 🦣"
echo "https://${MASTODON_INSTANCE}/web/statuses/${toot}"
- name: πŸ“§ Mail it πŸ“§
run: |
content=$(cat <<EOF
Expand Down

0 comments on commit bc5cf0c

Please sign in to comment.