Skip to content

Commit cf49e9a

Browse files
authored
Custom Action for sending Tweets (#784)
* Experimental custom Action for sending Tweets * Added license headers * Added README file * Updated package descriptions
1 parent 5457e2b commit cf49e9a

File tree

6 files changed

+34139
-0
lines changed

6 files changed

+34139
-0
lines changed

.github/actions/send-tweet/README.md

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# Send Tweet GitHub Action
2+
3+
This is a minimalistic GitHub Action for posting Firebase release announcements
4+
to Twitter. Simply specify the Twitter API keys along with the Tweet status to
5+
be posted.
6+
7+
## Inputs
8+
9+
### `status`
10+
11+
**Required** Text of the Tweet to send.
12+
13+
### `consumer-key`
14+
15+
**Required** Consumer API key from Twitter.
16+
17+
### `consumer-secret`
18+
19+
**Required** Consumer API secret key from Twitter.
20+
21+
### `access-token`
22+
23+
**Required** Twitter application access token.
24+
25+
### `access-token-secret`
26+
27+
**Required** Twitter application access token secret.
28+
29+
## Example usage
30+
31+
```
32+
- name: Send Tweet
33+
uses: firebase/firebase-admin-node/.github/actions/send-tweet
34+
with:
35+
status: >
36+
v1.2.3 of @Firebase Admin Node.js SDK is available.
37+
Release notes at https://firebase.google.com.
38+
consumer-key: ${{ secrets.TWITTER_CONSUMER_KEY }}
39+
consumer-secret: ${{ secrets.TWITTER_CONSUMER_SECRET }}
40+
access-token: ${{ secrets.TWITTER_ACCESS_TOKEN }}
41+
access-token-secret: ${{ secrets.TWITTER_ACCESS_TOKEN_SECRET }}
42+
```
43+
44+
## Implementation
45+
46+
This Action uses the `twitter` NPM package to send Tweets.
47+
48+
When making a code change remember to run `npm run pack` to rebuild the
49+
`dist/index.js` file which is the executable of this Action.

.github/actions/send-tweet/action.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# Copyright 2020 Google Inc.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
name: 'Send Tweet Action'
16+
description: 'Send Tweets from GitHub Actions workflows.'
17+
inputs:
18+
repo:
19+
status: Status (Tweet) to be posted
20+
required: true
21+
consumer-key:
22+
description: Consumer API key.
23+
required: true
24+
consumer-secret:
25+
description: Consumer API secret key.
26+
required: true
27+
access-token:
28+
description: Application access token.
29+
required: true
30+
access-token-secret:
31+
description: Application access token secret.
32+
required: true
33+
runs:
34+
using: 'node12'
35+
main: 'dist/index.js'

0 commit comments

Comments
 (0)