Skip to content

Custom Action for sending Tweets #784

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Feb 13, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 49 additions & 0 deletions .github/actions/send-tweet/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# Send Tweet GitHub Action

This is a minimalistic GitHub Action for posting Firebase release announcements
to Twitter. Simply specify the Twitter API keys along with the Tweet status to
be posted.

## Inputs

### `status`

**Required** Text of the Tweet to send.

### `consumer-key`

**Required** Consumer API key from Twitter.

### `consumer-secret`

**Required** Consumer API secret key from Twitter.

### `access-token`

**Required** Twitter application access token.

### `access-token-secret`

**Required** Twitter application access token secret.

## Example usage

```
- name: Send Tweet
uses: firebase/firebase-admin-node/.github/actions/send-tweet
with:
status: >
v1.2.3 of @Firebase Admin Node.js SDK is available.
Release notes at https://firebase.google.com.
consumer-key: ${{ secrets.TWITTER_CONSUMER_KEY }}
consumer-secret: ${{ secrets.TWITTER_CONSUMER_SECRET }}
access-token: ${{ secrets.TWITTER_ACCESS_TOKEN }}
access-token-secret: ${{ secrets.TWITTER_ACCESS_TOKEN_SECRET }}
```

## Implementation

This Action uses the `twitter` NPM package to send Tweets.

When making a code change remember to run `npm run pack` to rebuild the
`dist/index.js` file which is the executable of this Action.
35 changes: 35 additions & 0 deletions .github/actions/send-tweet/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Copyright 2020 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

name: 'Send Tweet Action'
description: 'Send Tweets from GitHub Actions workflows.'
inputs:
repo:
status: Status (Tweet) to be posted
required: true
consumer-key:
description: Consumer API key.
required: true
consumer-secret:
description: Consumer API secret key.
required: true
access-token:
description: Application access token.
required: true
access-token-secret:
description: Application access token secret.
required: true
runs:
using: 'node12'
main: 'dist/index.js'
Loading