-
Notifications
You must be signed in to change notification settings - Fork 492
24 lines (23 loc) · 883 Bytes
/
tweet.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
name: Send URLs from Commit Message as Tweets
on:
push:
branches:
- main
jobs:
tweet:
runs-on: ubuntu-latest
if: "contains(github.event.head_commit.message, 'https')"
steps:
- name: Extract Line with URL as Tweet Message
run: |
echo -e "${{ github.event.head_commit.message }}" >> tweet
tweet_message="$(cat tweet | grep -m 1 https*)"
echo "tweet_message=$tweet_message" >> $GITHUB_ENV
- name: Send Tweet
uses: ethomson/send-tweet-action@v1
with:
status: ${{ env.tweet_message }}
consumer-key: ${{ secrets.TWITTER_CONSUMER_API_KEY }}
consumer-secret: ${{ secrets.TWITTER_CONSUMER_API_SECRET }}
access-token: ${{ secrets.TWITTER_ACCESS_TOKEN }}
access-token-secret: ${{ secrets.TWITTER_ACCESS_TOKEN_SECRET }}