-
Notifications
You must be signed in to change notification settings - Fork 2
/
action.yml
138 lines (129 loc) · 4.68 KB
/
action.yml
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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
name: 'Jobs Updater'
description: "Respond on a trigger and parse a jobs file for changes, posting to one or more services."
inputs:
filename:
description: the filename for the jobs
required: true
previous_filename:
description: the previous filename (usually only for manual tesing)
required: false
keys:
description: Comma separated list of keys to post (defaults to url)
required: false
default: url
unique:
description: Field to use to determine uniqueness
required: true
default: url
hashtag:
description: A hashtag to use (defaults to <hashtag>Rseng)
required: false
default: "#RSEng"
test:
description: Test the updater (ensure there are jobs)
required: true
default: false
deploy:
description: Global deploy across any service set to true?
required: true
default: true
slack_deploy:
description: Deploy to Slack?
required: true
default: false
slack_webhook:
description: Slack webhook to deploy to.
required: false
discord_deploy:
description: Deploy to Discord?
required: true
default: false
discord_webhook:
description: Discord webhook to deploy to.
required: false
# If you want to post to BlueSky, both of these are required
bluesky_deploy:
description: Boolean to deploy to BlueSky
required: false
bluesky_password:
description: BlueSky account password
required: false
bluesky_email:
description: BlueSky account email
required: false
# If you want to post to Twitter, all of these credentials are required for a specific user
# API keys are typically generated on behalf of a user (at the bottom of the interface)
twitter_deploy:
description: Deploy to Twitter?
required: false
twitter_api_key:
description: API key generated for the user account to tweet
required: false
twitter_api_secret:
description: API secret generated for the user account to tweet
required: false
# Consumer keys are at the top of the developer interface, overall for the app (not a particular user)
twitter_consumer_key:
description: consumer key generated for the entire app
required: false
twitter_consumer_secret:
description: consumer secret generated for the entire app
required: false
# If you want to post to Mastodon, these values are required
mastodon_deploy:
description: Boolean to deploy to Mastodon
required: false
mastodon_access_token:
description: API key generated for the user account to tweet
required: false
mastodon_api_base_url:
description: Base URL of the Mastodon instance to post to, e.g., https://fosstodon.org/
required: false
outputs:
fields:
description: Fields (keys) parsed
value: ${{ steps.jobs-updater.outputs.fields }}
matrix:
description: Matrix (list of lists) with value (index 1), icon (index 2) and full message (index 3)
value: ${{ steps.jobs-updater.outputs.matrix }}
empty_matrix:
description: true if empty, false otherwise
value: ${{ steps.jobs-updated.outputs.empty_matrix }}
runs:
using: "composite"
steps:
- name: Install Python Dependencies
run: |
pip install pyyaml requests Mastodon.py atproto
pip install git+https://github.com/tweepy/tweepy.git
shell: bash
- name: Run action entrypoint
id: jobs-updater
env:
INPUT_PREVIOUS_FILENAME: ${{ inputs.previous_filename }}
INPUT_FILENAME: ${{ inputs.filename }}
INPUT_KEYS: ${{ inputs.keys }}
INPUT_UNIQUE: ${{ inputs.unique }}
CURRENT_SHA: ${{ github.sha }}
ACTION_DIR: ${{ github.action_path }}
INPUT_REPO: ${{ github.repository }}
INPUT_TEST: ${{ inputs.test }}
INPUT_HASHTAG: ${{ inputs.hashtag }}
INPUT_DEPLOY: ${{ inputs.deploy }}
SLACK_DEPLOY: ${{ inputs.slack_deploy }}
SLACK_WEBHOOK: ${{ inputs.slack_webhook }}
BLUESKY_DEPLOY: ${{ inputs.bluesky_deploy }}
BLUESKY_PASSWORD: ${{ inputs.bluesky_password }}
BLUESKY_EMAIL: ${{ inputs.bluesky_email }}
TWITTER_DEPLOY: ${{ inputs.twitter_deploy }}
TWITTER_API_KEY: ${{ inputs.twitter_api_key }}
TWITTER_API_SECRET: ${{ inputs.twitter_api_secret }}
TWITTER_CONSUMER_KEY: ${{ inputs.twitter_consumer_key }}
TWITTER_CONSUMER_SECRET: ${{ inputs.twitter_consumer_secret }}
DISCORD_DEPLOY: ${{ inputs.discord_deploy }}
DISCORD_WEBHOOK: ${{ inputs.discord_webhook }}
MASTODON_DEPLOY: ${{ inputs.mastodon_deploy }}
MASTODON_ACCESS_TOKEN: ${{ inputs.mastodon_access_token }}
MASTODON_API_BASE_URL: ${{ inputs.mastodon_api_base_url }}
run: ${{ github.action_path }}/entrypoint.sh
shell: bash