-
Notifications
You must be signed in to change notification settings - Fork 3
34 lines (29 loc) · 1.13 KB
/
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
25
26
27
28
29
30
31
32
33
34
name: Tweet
on:
repository_dispatch:
types: [nodekitten]
# tweet manually in case automation failed us
workflow_dispatch:
inputs:
version:
description: "Node version (e.g. 1.2.3)"
required: true
jobs:
update:
runs-on: ubuntu-latest
steps:
# unify version from different triggers
# https://docs.github.com/en/actions/reference/workflow-commands-for-github-actions#setting-an-environment-variable
- run: echo "NODE_VERSION=${{ github.event.client_payload.version }" >> $GITHUB_ENV
if: github.event_name == 'repository_dispatch'
- run: echo "NODE_VERSION=${{ github.event.inputs.version }" >> $GITHUB_ENV
if: github.event_name == 'workflow_dispatch'
- run: |
MY_STRING=$(cat << EOF
There's a new @nodejs release available: Node.js v{{ secrets.NODE_VERSION }} is out now! 🙀
$ nvm install {{ secrets.NODE_VERSION }}
🔗 Release post (will be) available here:
https://nodejs.org/en/blog/release/v{{ secrets.NODE_VERSION }}/` // define what we're going to tweet
EOF
)
echo $TWEET