- Tweet message to Twitter
- User defined custom message
- Render using EJS
Key | Required | Type | Description |
---|---|---|---|
message | false | string | Plain message to tweetdata , data_filename , template and template_filename |
data | false | string (JSON) | Parameters to render in template Be sure to specify either data or data_filename data_filename |
data_filename | false | string | Filename where data is saved |
template | false | string | Template string based on EJS Please refer to EJS Homepage for how to write Be sure to specify either template or template_filename template_filename |
template_filename | false | string | Filename where template is written |
oauth_consumer_key | true | string | API key for OAuth 1.0a See Twitter Docs for details |
oauth_consumer_secret | true | string | API secret for OAuth 1.0a See Twitter Docs for details |
oauth_token | true | string | Access token for OAuth 1.0a See Twitter Docs for details |
oauth_token_secret | true | string | Access token secret for OAuth 1.0a See Twitter Docs for details |
steps:
- uses: lazy-actions/tweet-action@main
with:
message: Hello World
oauth_consumer_key: ${{ secrets.OAUTH_CONSUMER_KEY }}
oauth_consumer_secret: ${{ secrets.OAUTH_CONSUMER_SECRET }}
oauth_token: ${{ secrets.OAUTH_TOKEN }}
oauth_token_secret: ${{ secrets.OAUTH_TOKEN_SECRET }}
steps:
- uses: lazy-actions/tweet-action@main
with:
data: |
{
"name": "lazy-actions"
}
template: 'Hello <%- name %>'
oauth_consumer_key: ${{ secrets.OAUTH_CONSUMER_KEY }}
oauth_consumer_secret: ${{ secrets.OAUTH_CONSUMER_SECRET }}
oauth_token: ${{ secrets.OAUTH_TOKEN }}
oauth_token_secret: ${{ secrets.OAUTH_TOKEN_SECRET }}
steps:
- uses: lazy-actions/tweet-action@main
with:
data_filename: tests/fixtures/data.json
template_filename: tests/fixtures/template.ejs
oauth_consumer_key: ${{ secrets.OAUTH_CONSUMER_KEY }}
oauth_consumer_secret: ${{ secrets.OAUTH_CONSUMER_SECRET }}
oauth_token: ${{ secrets.OAUTH_TOKEN }}
oauth_token_secret: ${{ secrets.OAUTH_TOKEN_SECRET }}
GitHub Actions Workflow file is .github/workflows/tweet.yaml. And template file is assets/template.ejs
Tweet Result ⬇️