-
-
Notifications
You must be signed in to change notification settings - Fork 70
45 lines (44 loc) · 2.3 KB
/
tweet-rfc-update.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
38
39
40
41
42
43
44
45
name: Tweet RFC Update
on:
# Can't use pull_request because it won't have access to secrets
pull_request_target:
types: [labeled, closed]
jobs:
tweetStateChange:
runs-on: ubuntu-latest
if: github.event.action == 'labeled' && contains(github.event.label.name, 'Commenting')
steps:
- uses: actions/setup-node@v3
with:
node-version: '18.x'
- run: npx @humanwhocodes/tweet "The RFC '$TITLE' is now in the ${{ github.event.label.name }} phase.\n\n${{ github.event.pull_request.html_url }}"
env:
TITLE: ${{ github.event.pull_request.title }}
TWITTER_CONSUMER_KEY: ${{ secrets.TWITTER_CONSUMER_KEY }}
TWITTER_CONSUMER_SECRET: ${{ secrets.TWITTER_CONSUMER_SECRET }}
TWITTER_ACCESS_TOKEN_KEY: ${{ secrets.TWITTER_ACCESS_TOKEN_KEY }}
TWITTER_ACCESS_TOKEN_SECRET: ${{ secrets.TWITTER_ACCESS_TOKEN_SECRET }}
- run: npx @humanwhocodes/toot "The RFC '$TITLE' is now in the ${{ github.event.label.name }} phase.\n\n${{ github.event.pull_request.html_url }}"
env:
TITLE: ${{ github.event.pull_request.title }}
MASTODON_ACCESS_TOKEN: ${{ secrets.MASTODON_ACCESS_TOKEN }}
MASTODON_HOST: ${{ secrets.MASTODON_HOST }}
tweetMerge:
runs-on: ubuntu-latest
if: github.event.action == 'closed' && github.event.pull_request.merged && contains(github.event.pull_request.labels.*.name, 'Final Commenting')
steps:
- uses: actions/setup-node@v3
with:
node-version: '18.x'
- run: npx @humanwhocodes/tweet "The RFC '$TITLE' has been approved and merged!\n\n${{ github.event.pull_request.html_url }}"
env:
TITLE: ${{ github.event.pull_request.title }}
TWITTER_CONSUMER_KEY: ${{ secrets.TWITTER_CONSUMER_KEY }}
TWITTER_CONSUMER_SECRET: ${{ secrets.TWITTER_CONSUMER_SECRET }}
TWITTER_ACCESS_TOKEN_KEY: ${{ secrets.TWITTER_ACCESS_TOKEN_KEY }}
TWITTER_ACCESS_TOKEN_SECRET: ${{ secrets.TWITTER_ACCESS_TOKEN_SECRET }}
- run: npx @humanwhocodes/toot "The RFC '$TITLE' has been approved and merged!\n\n${{ github.event.pull_request.html_url }}"
env:
TITLE: ${{ github.event.pull_request.title }}
MASTODON_ACCESS_TOKEN: ${{ secrets.MASTODON_ACCESS_TOKEN }}
MASTODON_HOST: ${{ secrets.MASTODON_HOST }}