-
Notifications
You must be signed in to change notification settings - Fork 2
112 lines (105 loc) · 3.32 KB
/
__social-post.yml
File metadata and controls
112 lines (105 loc) · 3.32 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
---
# Send social media post to various platforms.
name: Social Media Post
permissions: {}
on:
workflow_dispatch:
inputs:
discord:
description: 'Send a Discord announcement'
required: false
default: false
type: boolean
facebook_page:
description: 'Post to the Facebook page'
required: false
default: false
type: boolean
reddit:
description: 'Post to Reddit'
required: false
default: false
type: boolean
x:
description: 'Post to X'
required: false
default: false
type: boolean
title:
description: 'Title of the post'
default: ''
required: false
type: string
body:
description: 'Body of the post'
default: ''
required: false
type: string
url:
description: 'URL to include in the post. Does not apply to X'
default: ''
required: false
type: string
jobs:
discord:
if: inputs.discord
permissions: {}
runs-on: ubuntu-latest
steps:
- name: discord
uses: sarisia/actions-status-discord@eb045afee445dc055c18d3d90bd0f244fd062708 # v1.16.0
with:
avatar_url: ${{ vars.ORG_LOGO_URL }}256
color: 0x${{ vars.COLOR_HEX_GREEN }}
description: ${{ inputs.body }}
nodetail: true
nofail: false
title: ${{ inputs.title }}
url: ${{ inputs.url }}
username: ${{ vars.DISCORD_USERNAME }}
webhook: ${{ secrets.DISCORD_RELEASE_WEBHOOK }}
facebook_page:
if: inputs.facebook_page
permissions: {}
runs-on: ubuntu-latest
steps:
- name: facebook-post-action
uses: LizardByte/actions/actions/facebook_post@4125866b7b655a6fe038b0e22a43a4c5d259af79 # v2026.417.35446
with:
page_id: ${{ secrets.FACEBOOK_PAGE_ID }}
access_token: ${{ secrets.FACEBOOK_ACCESS_TOKEN }}
message: |
${{ inputs.title }}
${{ inputs.body }}
url: ${{ inputs.url }}
reddit:
if: inputs.reddit
permissions: {}
runs-on: ubuntu-latest
steps:
- name: reddit
uses: bluwy/release-for-reddit-action@b4ee0e0d64da893e0428912aac5cda675082bd85 # v2
with:
username: ${{ vars.REDDIT_USERNAME }}
password: ${{ secrets.REDDIT_PASSWORD }}
app-id: ${{ secrets.REDDIT_CLIENT_ID }}
app-secret: ${{ secrets.REDDIT_CLIENT_SECRET }}
subreddit: ${{ vars.REDDIT_SUBREDDIT }}
title: ${{ inputs.title }}
url: ${{ inputs.url }}
flair-id: ${{ secrets.REDDIT_FLAIR_ID }} # https://www.reddit.com/r/<subreddit>>/api/link_flair.json
comment: ${{ inputs.body }}
x:
if: inputs.x
permissions: {}
runs-on: ubuntu-latest
steps:
- name: x
uses: nearform-actions/github-action-notify-twitter@b3fa623c2f320117e8a08e20564c4ce0a5e67930 # v1.2.3
# alternative: noweh/post-tweet-v2-action@v1.0
with:
message: "${{ inputs.title }}: ${{ inputs.body }}"
twitter-app-key: ${{ secrets.X_APP_KEY }}
twitter-app-secret: ${{ secrets.X_APP_SECRET }}
twitter-access-token: ${{ secrets.X_ACCESS_TOKEN }}
twitter-access-token-secret: ${{ secrets.X_ACCESS_TOKEN_SECRET }}