Skip to content

Improve UI and UX for App #103

Improve UI and UX for App

Improve UI and UX for App #103

Workflow file for this run

name: Post to BlueSky
on:
# Trigger automatically when a PR is merged
pull_request:
types:
- closed
# Allow manual triggering
workflow_dispatch:
inputs:
text:
description: 'Post Text (Required for manual trigger)'
required: true
type: string
link:
description: 'Link URL for Preview (Required for manual trigger)'
required: true
type: string
# authorName input is kept as requested, but not directly used in the post step below.
# You might want to incorporate it into the 'text' input manually when triggering.
authorName:
description: 'Author Name (Optional, for information)'
required: false
type: string
release:
types: [published]
jobs:
# Job for posting when a PR is merged
post_on_merge:
# Only run this job for the pull_request trigger IF it was merged
if: github.event.pull_request.merged == true
runs-on: ubuntu-latest
steps:
# Add this step before the 'Post Merged PR to BlueSky' step
- name: Debug Secret Availability
run: |
echo "BSKY_IDENTIFIER is set: ${{ secrets.BSKY_IDENTIFIER != '' }}"
echo "BSKY_PASSWORD is set: ${{ secrets.BSKY_PASSWORD != '' }}"
- name: Post Merged PR to BlueSky
uses: myConsciousness/bluesky-post@v5
with:
# Use PR title and author login for the text
text: ${{ format('{0} by {1}', github.event.pull_request.title, github.event.pull_request.user.login) }}
# Use the PR's HTML URL for the link preview
link-preview-url: ${{ github.event.pull_request.html_url }} # Use html_url, it's more standard
identifier: ${{ secrets.BSKY_IDENTIFIER }}
password: ${{ secrets.BSKY_PASSWORD }}
env:
BSKY_IDENTIFIER: ${{ secrets.BSKY_IDENTIFIER }}
BSKY_PASSWORD: ${{ secrets.BSKY_PASSWORD }}
# Job for posting when a PR is merged
post_on_release:
# Only run this job for the pull_request trigger IF it was merged
if: github.event_name == 'release'
runs-on: ubuntu-latest
steps:
# Add this step before the 'Post Merged PR to BlueSky' step
- name: Debug Secret Availability
run: |
echo "BSKY_IDENTIFIER is set: ${{ secrets.BSKY_IDENTIFIER != '' }}"
echo "BSKY_PASSWORD is set: ${{ secrets.BSKY_PASSWORD != '' }}"
- name: Post Merged PR to BlueSky
uses: myConsciousness/bluesky-post@v5
with:
# Use PR title and author login for the text
text: ${{ format('New Release {0} is out 🎉', github.event.release.name) }}
# Use the PR's HTML URL for the link preview
link-preview-url: ${{ github.event.release.html_url }} # Use html_url, it's more standard
identifier: ${{ secrets.BSKY_IDENTIFIER }}
password: ${{ secrets.BSKY_PASSWORD }}
env:
BSKY_IDENTIFIER: ${{ secrets.BSKY_IDENTIFIER }}
BSKY_PASSWORD: ${{ secrets.BSKY_PASSWORD }}
# Job for posting when manually triggered
post_manually:
# Only run this job for the workflow_dispatch trigger
if: github.event_name == 'workflow_dispatch'
runs-on: ubuntu-latest
steps:
# Add this step before the 'Post Merged PR to BlueSky' step
- name: Debug Secret Availability
run: |
echo "BSKY_IDENTIFIER is set: ${{ secrets.BSKY_IDENTIFIER != '' }}"
echo "BSKY_PASSWORD is set: ${{ secrets.BSKY_PASSWORD != '' }}"
- name: Post Manually to BlueSky
uses: myConsciousness/bluesky-post@v5
with:
# Use the text provided in the manual trigger input
text: ${{ format('{0} by @{1}', github.event.inputs.text, github.event.inputs.authorName) }}
link-preview-url: ${{ github.event.inputs.link }} # Use the link provided in the manual trigger input
identifier: ${{ secrets.BSKY_IDENTIFIER }}
password: ${{ secrets.BSKY_PASSWORD }}