Skip to content
package

GitHub Action

Send Tweet v2

v1 Latest version

Send Tweet v2

package

Send Tweet v2

Publish a tweet using the Twitter v2 API

Installation

Copy and paste the following snippet into your .yml file.

              

- name: Send Tweet v2

uses: smapiot/send-tweet-v2-action@v1

Learn more about this action in smapiot/send-tweet-v2-action

Choose a version

Send Tweet v2 Action

This GitHub action publishes a Twitter Post (tweet) using the Twitter v2 API.

Inputs

status

Required The content of the tweet to send.

consumer-key

Required The API key to use. Most feed services will require an API key.

consumer-secret

Required The base directory relative to the project root.

access-token

Required The bundler to use if nothing is specified in the code.

access-token-secret

Required The bundler to use if nothing is specified in the code.

Outputs

id

The ID of the created tweet.

Example Usage

The simplified usage looks like:

uses: smapiot/send-tweet-v2-action@v2
with:
  status: 'Hi Mum!'
  consumer-key: 'abcdef1234567890'
  consumer-secret: 'abcdef1234567890'
  access-token: '1234gvjgejge-AnLgeogegeq'
  access-token-secret: 'abQA225353mfk53'

A complete example could thus look as follows:

on:
  push:
    branches:
      - main

jobs:
  publish-pilet:
    name: Send Tweet
    runs-on: [ubuntu-16.04]
    steps:
    - name: Tweet
      uses: smapiot/send-tweet-v2-action@v2
      with:
        status: 'Hi Mum!'
        consumer-key: ${{ secrets.CONSUMER_KEY }}
        consumer-secret: ${{ secrets.CONSUMER_SECRET }}
        access-token: ${{ secrets.ACCESS_TOKEN }}
        access-token-secret: ${{ secrets.ACCESS_TOKEN_SECRET }}