Skip to content

Commit d400f81

Browse files
Update postBlueSky.yml
1 parent d809311 commit d400f81

File tree

1 file changed

+35
-17
lines changed

1 file changed

+35
-17
lines changed

.github/workflows/postBlueSky.yml

Lines changed: 35 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,57 @@
11
name: Post to BlueSky
22

33
on:
4+
# Trigger automatically when a PR is merged
45
pull_request:
56
types:
67
- closed
8+
# Allow manual triggering
79
workflow_dispatch:
810
inputs:
911
text:
10-
description: 'Post Text'
12+
description: 'Post Text (Required for manual trigger)'
1113
required: true
12-
type: choice
13-
options:
14-
- patch
15-
- minor
16-
- major
14+
type: string
1715
link:
18-
description: 'Links'
16+
description: 'Link URL for Preview (Required for manual trigger)'
1917
required: true
2018
type: string
19+
# authorName input is kept as requested, but not directly used in the post step below.
20+
# You might want to incorporate it into the 'text' input manually when triggering.
2121
authorName:
22-
description: 'Author Name'
23-
required: true
22+
description: 'Author Name (Optional, for information)'
23+
required: false
2424
type: string
2525

2626
jobs:
27-
if_merged:
28-
if: github.event.pull_request.merged == true
27+
# Job for posting when a PR is merged
28+
post_on_merge:
29+
# Only run this job for the pull_request trigger IF it was merged
30+
if: github.event_name == 'pull_request' && github.event.pull_request.merged == true
31+
runs-on: ubuntu-latest
32+
steps:
33+
- name: Post Merged PR to BlueSky
34+
uses: myConsciousness/bluesky-post@v5
35+
with:
36+
# Use PR title and author login for the text
37+
text: ${{ format('{0} by @{1}', github.event.pull_request.title, github.event.pull_request.user.login) }}
38+
# Use the PR's HTML URL for the link preview
39+
link-preview-url: ${{ github.event.pull_request.html_url }} # Use html_url, it's more standard
40+
identifier: ${{ secrets.BSKY_IDENTIFIER }}
41+
password: ${{ secrets.BSKY_PASSWORD }}
42+
43+
# Job for posting when manually triggered
44+
post_manually:
45+
# Only run this job for the workflow_dispatch trigger
46+
if: github.event_name == 'workflow_dispatch'
2947
runs-on: ubuntu-latest
3048
steps:
31-
# - run: |
32-
# echo ${{ github.event.pull_request.title }} \n ${{ github.event.pull_request._links.html.href }}
33-
34-
- uses: myConsciousness/bluesky-post@v5
49+
- name: Post Manually to BlueSky
50+
uses: myConsciousness/bluesky-post@v5
3551
with:
36-
text: ${{ github.event.pull_request.title }} by ${{ github.event.pull_request.user.login }}
37-
link-preview-url: ${{ github.event.pull_request._links.html.href }}
52+
# Use the text provided in the manual trigger input
53+
text: ${{ github.event.inputs.text }}
54+
# Use the link provided in the manual trigger input
55+
link-preview-url: ${{ github.event.inputs.link }}
3856
identifier: ${{ secrets.BSKY_IDENTIFIER }}
3957
password: ${{ secrets.BSKY_PASSWORD }}

0 commit comments

Comments
 (0)