File tree Expand file tree Collapse file tree 1 file changed +37
-0
lines changed
Expand file tree Collapse file tree 1 file changed +37
-0
lines changed Original file line number Diff line number Diff line change 1+ name : Create Tweet on X
2+
3+ on :
4+ release :
5+ types : [ published ]
6+
7+ jobs :
8+ tweet :
9+ runs-on : ubuntu-latest
10+ steps :
11+ - uses : actions/setup-go@v5
12+ with :
13+ go-version : stable
14+ - name : Create Tweet on X
15+ run : |
16+ go install github.com/DanielLiu1123/xcli/cmd/xcli@latest
17+
18+ RELEASE_TAG="${{ github.event.release.tag_name }}"
19+ REPO_NAME="${{ github.repository }}"
20+ REPO_DESCRIPTION="${{ github.event.repository.description }}"
21+
22+ TWEET_TEXT=$(printf "🎉 %s has released %s!\n\n%s: %s\n\n#Java #Junit\n\n🔗 Check it out: %s" \
23+ "${REPO_NAME}" \
24+ "${RELEASE_TAG}" \
25+ "${REPO_NAME#*/}" \
26+ "${REPO_DESCRIPTION}" \
27+ "https://github.com/${REPO_NAME}/releases/tag/${RELEASE_TAG}"
28+ )
29+
30+ echo "Tweeting content:"
31+ echo "${TWEET_TEXT}"
32+
33+ xcli tweet create --text="${TWEET_TEXT}" \
34+ --api-key="${{ secrets.X_API_KEY }}" \
35+ --api-secret="${{ secrets.X_API_SECRET }}" \
36+ --access-token="${{ secrets.X_ACCESS_TOKEN }}" \
37+ --access-secret="${{ secrets.X_ACCESS_SECRET }}"
You can’t perform that action at this time.
0 commit comments