-
Notifications
You must be signed in to change notification settings - Fork 4
37 lines (31 loc) · 1.26 KB
/
create-tweet-on-x.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
name: Create Tweet on X
on:
release:
types: [ published ]
jobs:
tweet:
runs-on: ubuntu-latest
steps:
- uses: actions/setup-go@v5
with:
go-version: stable
- name: Create Tweet on X
run: |
go install github.com/DanielLiu1123/xcli/cmd/xcli@latest
RELEASE_TAG="${{ github.event.release.tag_name }}"
REPO_NAME="${{ github.repository }}"
REPO_DESCRIPTION="${{ github.event.repository.description }}"
TWEET_TEXT=$(printf "🎉 %s has released %s!\n\n%s: %s\n\n#Java #Spring #SpringBoot #gRPC\n\n🔗 Check it out: %s" \
"${REPO_NAME}" \
"${RELEASE_TAG}" \
"${REPO_NAME#*/}" \
"${REPO_DESCRIPTION}" \
"https://github.com/${REPO_NAME}/releases/tag/${RELEASE_TAG}"
)
echo "Tweeting content:"
echo "${TWEET_TEXT}"
xcli tweet create --text="${TWEET_TEXT}" \
--api-key="${{ secrets.X_API_KEY }}" \
--api-secret="${{ secrets.X_API_SECRET }}" \
--access-token="${{ secrets.X_ACCESS_TOKEN }}" \
--access-secret="${{ secrets.X_ACCESS_SECRET }}"