diff options
author | 2021-12-02 14:04:11 -0600 | |
---|---|---|
committer | 2021-12-02 14:04:11 -0600 | |
commit | e0414ac865d9cdfa16c5a2abc9e4ce33947b5b2f (patch) | |
tree | 609940d84931b6cd07aeb9056e4346a77c1678fc /scripts/notify | |
parent | 3a8c9a6408fcc3ae3776a4380f447f776341ce68 (diff) | |
download | astro-e0414ac865d9cdfa16c5a2abc9e4ce33947b5b2f.tar.gz astro-e0414ac865d9cdfa16c5a2abc9e4ce33947b5b2f.tar.zst astro-e0414ac865d9cdfa16c5a2abc9e4ce33947b5b2f.zip |
Cleanup Actions (#2088)
* chore: actions cleanup
* chore: make release messages more fun
* chore: fix casing
* chore(lint): Prettier fix
Co-authored-by: GitHub Action <github-action@users.noreply.github.com>
Diffstat (limited to 'scripts/notify')
-rwxr-xr-x | scripts/notify/index.js | 31 |
1 files changed, 28 insertions, 3 deletions
diff --git a/scripts/notify/index.js b/scripts/notify/index.js index e5e9f08c5..a74f3a52f 100755 --- a/scripts/notify/index.js +++ b/scripts/notify/index.js @@ -3,6 +3,27 @@ import { createRequire } from 'module'; const require = createRequire(import.meta.url); const baseUrl = new URL('https://github.com/withastro/astro/blob/main/'); +const emojis = ['🎉', '🥳', '🚀', '🧑🚀', '🎊', '🏆', '✅', '🤩', '🤖', '🙌']; +const descriptors = ['new releases', 'fresh new code', 'shiny updates', 'exciting stuff', 'package updates', 'awesome updates', 'bug fixes and features', 'updates']; +const verbs = [ + 'just went out!', + 'now available!', + 'in the wild!', + 'now live!', + 'hit the registry!', + 'to share!', + 'for you!', + "for y'all!", + "comin' your way!", + "comin' atcha!", + "comin' in hot!", + ', freshly minted on the blockchain! (jk)', +]; + +function item(items) { + return items[Math.floor(Math.random() * items.length)]; +} + async function run() { const releases = process.argv.slice(2)[0]; const data = JSON.parse(releases); @@ -13,13 +34,17 @@ async function run() { }) ); + const emoji = item(emojis); + const descriptor = item(descriptors); + const verb = item(verbs); + if (packages.length === 1) { const { name, version, url } = packages[0]; - console.log(`\`${name}@${version}\` was just released! Read the [release notes →](<${url}>)`); + console.log(`${emoji} \`${name}@${version}\` ${verb}\nRead the [release notes →](<${url}>)`); } else { - console.log(`**Some new releases just went out!**\n`); + console.log(`${emoji} Some ${descriptor} ${verb}\n`); for (const { name, version, url } of packages) { - console.log(` • \`${name}@${version}\` ([Release Notes →](<${url}>))`); + console.log(`• \`${name}@${version}\` Read the [release notes →](<${url}>)`); } } } |