Skip to content

Commit

Permalink
Use xcli create tweet
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielLiu1123 committed Dec 6, 2024
1 parent f59ed94 commit 48e32db
Showing 1 changed file with 28 additions and 15 deletions.
43 changes: 28 additions & 15 deletions .github/workflows/create-post-on-x.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Create Post on X
name: Create Tweet on X

on:
push:
Expand All @@ -12,19 +12,32 @@ jobs:
- uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Setup Node
uses: actions/setup-node@v4
# - name: Setup Node
# uses: actions/setup-node@v4
# with:
# node-version: 22
# cache: yarn
# cache-dependency-path: ./tools/post-on-x/yarn.lock
# - name: Create post on X
# working-directory: ./tools/post-on-x
# env:
# X_CONSUMER_API_KEY: ${{ secrets.X_CONSUMER_API_KEY }}
# X_CONSUMER_API_SECRET_KEY: ${{ secrets.X_CONSUMER_API_SECRET_KEY }}
# X_ACCESS_TOKEN: ${{ secrets.X_ACCESS_TOKEN }}
# X_ACCESS_TOKEN_SECRET: ${{ secrets.X_ACCESS_TOKEN_SECRET }}
# run: |
# yarn install
# yarn start
- uses: actions/setup-go@v5
with:
node-version: 22
cache: yarn
cache-dependency-path: ./tools/post-on-x/yarn.lock
- name: Create post on X
working-directory: ./tools/post-on-x
env:
X_CONSUMER_API_KEY: ${{ secrets.X_CONSUMER_API_KEY }}
X_CONSUMER_API_SECRET_KEY: ${{ secrets.X_CONSUMER_API_SECRET_KEY }}
X_ACCESS_TOKEN: ${{ secrets.X_ACCESS_TOKEN }}
X_ACCESS_TOKEN_SECRET: ${{ secrets.X_ACCESS_TOKEN_SECRET }}
go-version: stable
- name: Create Tweet on X
run: |
yarn install
yarn start
go install github.com/DanielLiu1123/xcli/cmd/xcli@latest
COMMIT_MESSAGE="${{ github.event.head_commit.message }}"
xcli tweet create --text="${COMMIT_MESSAGE}" \
--api-key="${X_CONSUMER_API_KEY}" \
--api-secret="${X_CONSUMER_API_SECRET_KEY}" \
--access-token="${X_ACCESS_TOKEN}" \
--access-secret="${X_ACCESS_TOKEN_SECRET}"

0 comments on commit 48e32db

Please sign in to comment.