Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ethomson/send-tweet-action
Send a tweet from a GitHub Action
https://github.com/ethomson/send-tweet-action
Last synced: 14 days ago
JSON representation
Send a tweet from a GitHub Action
- Host: GitHub
- URL: https://github.com/ethomson/send-tweet-action
- Owner: ethomson
- License: mit
- Created: 2019-12-30T20:17:32.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2023-03-04T05:34:04.000Z (over 1 year ago)
- Last Synced: 2024-10-24T15:41:32.794Z (20 days ago)
- Language: TypeScript
- Homepage:
- Size: 1.56 MB
- Stars: 84
- Watchers: 3
- Forks: 8
- Open Issues: 11
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Send a tweet from a GitHub Actions workflow
Use this action to send a tweet from a GitHub actions workflow.
## Twitter Application Setup
First, you'll need to create a Twitter application if you haven't
already. This will allow you to programmatically authenticate to
the Twitter API and send a tweet.If you haven't already, visit
[developer.twitter.com/apps](https://developer.twitter.com/apps)
and create a Twitter application. Then create keys and tokens
to use for authentication.## Secret Configuration
Configure the authentication keys and tokens for your Twitter
app as secrets in your repository. I recommend using the
`TWITTER_CONSUMER_API_KEY`, `TWITTER_CONSUMER_API_SECRET`,
`TWITTER_ACCESS_TOKEN`, and `TWITTER_ACCESS_TOKEN_SECRET`
secrets.## Workflow Usage
Configure your workflow to use `ethomson/send-tweet-action@v1`,
and provide the tweet you want to send as the `status` input.Provide the authentication keys and tokens for your Twitter app
as the `consumer-key`, `consumer-secret`, `access-token`, and
`access-token-secret` inputs.For example:
```yml
name: Send a Tweet
on: [push]
jobs:
tweet:
runs-on: ubuntu-latest
steps:
- uses: ethomson/send-tweet-action@v1
with:
status: "Hi, this is a test!"
consumer-key: ${{ secrets.TWITTER_CONSUMER_API_KEY }}
consumer-secret: ${{ secrets.TWITTER_CONSUMER_API_SECRET }}
access-token: ${{ secrets.TWITTER_ACCESS_TOKEN }}
access-token-secret: ${{ secrets.TWITTER_ACCESS_TOKEN_SECRET }}
```Now whenever you push something to your repository, GitHub Actions
will tweet on your behalf.