Skip to content
Open
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
9 changes: 0 additions & 9 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,6 @@ jobs:
- name: Checkout code
uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: 3.x

- name: Install dependencies
run: |
pip install tweepy

- name: Run tweet script
uses: ./
with:
Expand Down
11 changes: 1 addition & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,8 @@ jobs:
- name: Checkout code
uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: 3.x

- name: Install dependencies
run: |
pip install tweepy

- name: Publish tweet
uses: intelowlproject/twitter-post
uses: intelowlproject/twitter_post@main
with:
status: Add publish notes here
api_key: ${{ secrets.TWITTER_API_KEY}}
Expand Down
22 changes: 3 additions & 19 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,25 +24,9 @@ outputs:
description: "Post's title"

runs:
using: "composite"
steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.x

- name: Install dependencies
run: |
pip install tweepy
shell: bash

- name: Run tweet script
run: python3 publish.py ${{ inputs.api_key }} ${{ inputs.api_key_secret }} ${{ inputs.access_token }} ${{ inputs.access_token_secret }} "${{ inputs.status }}"
shell: bash
using: "node16"
main: "index.js"

branding:
icon: "message-circle"
color: "blue"
color: "blue"
28 changes: 28 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
const { TwitterApi } = require('twitter-api-v2');

const {
INPUT_STATUS,
INPUT_API_KEY,
INPUT_API_KEY_SECRET,
INPUT_ACCESS_TOKEN,
INPUT_ACCESS_TOKEN_SECRET,
} = process.env;

(async () => {

try {
const userClient = new TwitterApi({
appKey: INPUT_API_KEY,
appSecret: INPUT_API_KEY_SECRET,
accessToken: INPUT_ACCESS_TOKEN,
accessSecret: INPUT_ACCESS_TOKEN_SECRET,
});

await userClient.v2.tweet(INPUT_STATUS);

} catch (err) {
console.log(err);
console.log(`::error ::${err.data}`);
}

})();
13 changes: 13 additions & 0 deletions node_modules/.package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

201 changes: 201 additions & 0 deletions node_modules/twitter-api-v2/LICENSE

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading