generated from RISC-OS-Community/StandardRepoTemplate
-
Notifications
You must be signed in to change notification settings - Fork 1
55 lines (46 loc) · 2.11 KB
/
tweet-pull-request.yaml
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
---
# Tweet notifications
name: Notify twitter of new Push to main branch
on:
# Paolo's note: Run on Pull requests merged to main only.
# It's a weird syntax, but, because a Pull Request always
# generates a "push" event when it gets merged, and given
# that we do not commit directly to main, we can use the
# syntax below and it will result on creating a tweet on
# our twitter ONLY when a Pull Request from Develop branch
# gets merged into Main branch, which is what we want.
push:
branches:
- main
# Paolo's note: Run when manually triggered.
# Because there are situations when we may need to trigger
# it manually, I just added this option. Please do not abuse
# of it :)
workflow_dispatch:
env:
THIS_REPO: ${{ github.repository }}
jobs:
# init:
# runs-on: ubuntu-latest
# steps:
# - name: Set current date as env variable
# run: echo "MSG_DATE=$(date +'%Y-%m-%d')" >> $GITHUB_ENV
#debug:
# runs-on: ubuntu-latest
# steps:
# - name: Verify ENV variables
# run: |
# echo "Today: ${{ env.MSG_DATE }}, new merge in ${{ env.THIS_REPO }}! You can check it out here: https://github.com/${{ env.THIS_REPO }} #RISC_OS #RISCOS #ROCOnGitHub #OpenSource #DevCommunity"
tweet:
runs-on: ubuntu-latest
steps:
- name: Set current date as env variable
run: echo "MSG_DATE=$(date +'%Y-%m-%d')" >> $GITHUB_ENV
- name: Send Tweet
uses: ethomson/send-tweet-action@v1
with:
status: "🎉 Today: ${{ env.MSG_DATE }}, new merge in ${{ env.THIS_REPO }}! ${{ github.event.pull_request.title }} You can check it out here: https://github.com/${{ env.THIS_REPO }} #RISC_OS #RISCOS #ROCOnGitHub #OpenSource #DevCommunity"
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 }}