diff options
author | 2021-11-29 15:11:15 -0600 | |
---|---|---|
committer | 2021-11-29 15:11:15 -0600 | |
commit | 4067151aec60ddb471cf9ca943b9a1a0338b37da (patch) | |
tree | 037082187a8381792acd642d942d6cfd6dad5f48 /scripts/notify | |
parent | 0f5e89f694718242816d752ff38f4fb4f2e8e50a (diff) | |
download | astro-4067151aec60ddb471cf9ca943b9a1a0338b37da.tar.gz astro-4067151aec60ddb471cf9ca943b9a1a0338b37da.tar.zst astro-4067151aec60ddb471cf9ca943b9a1a0338b37da.zip |
Improve GitHub Actions (#2041)
* chore(actions): test new CI action
* chore(actions): switch action order
* chore(actions): update registry
* chore(actions): remove debug
* chore(actions): target all packages
* chore(actions): test artifacts
* chore(actions): try moving artifacts
* chore(actions): test moving
* chore(actions): test tar approach
* chore(actions): test tar approach
* chore(actions): use artifacts/packages before tar
* chore(actions): test mv -vn
* chore(actions): mkdir first
* chore(actions): how does tar work?
* chore(actions): so good at bash
* chore(actions): test matrix
* chore(actions): fix test matrix
* chore(actions): fix windows?
* chore(actions): fix windows?
* chore(actions): fix windows!
* chore(actions): fix windows!
* chore(actions): add lint
* chore(actions): add back old actions
* chore(actions): test notification action
* chore(actions): test notification action again
* chore(actions): fix extract action
* chore(actions): fix action?
* chore(actions): fix action?
* chore(actions): fix newlines
* chore(actions): test --production flag
* chore(actions): test --production flag for test
* chore(actions): add execa to production deps
* chore(actions): add cheerio to production deps
* chore(actions): add production deps for tested examples
* chore(actions): fix changelog action
* chore(actions): attempt to use --prefer-offline
* chore(actions): revert dependencies/devDependencies change
* chore(actions): update all actions
* chore(actions): add smoke test
* chore(actions): update changelog deps
* chore(actions): move notify script
* chore(actions): consolidate main scripts
* chore(actions): update changelog name
* chore(actions): update congratsbot
* chore(actions): update ci
* chore(actions): change lint/format strategy
* chore(actions): expose GITHUB_TOKEN to linter
* chore(actions): update lint
* chore(actions): enable autofix
* chore(actions): fetch-depth 0
* chore(actions): fix eslint extensions
* chore(actions): debug lint
* chore(actions): fix eslint args
* chore(actions): fix eslint?
* [ci] ESLint fix
* [ci] Prettier fix
* chore(actions): fix lint!
* chore(actions): cleanup comments
* chore(actions): fix lint
* chore(actions): lint astro only
* chore(actions): ignore pattern
* chore(actions): no_verify
* chore(actions): disable no verify
* chore(actions): debug status
* chore(actions): add concurrency
* chore(actions): add comment about concurrency
* chore(actions): make release dependent on lint
* chore(actions): move lint first
* chore(actions): run CI on PR or `main` only
* chore(actions): remove GPR publish step
* chore: add back old actions
* chore: revert package.json
* chore: improve changelog with GitHub info
* chore(actions): try pull_request_target
* debug lint
* debug lint
* debug lint
* try pull_request_target
* update pull_request_target perms
* update pull_request_target
* fix perms
* fix run?
* fix run?
* fix run? (part 3)
* fix run? (part 4)
* fix run? (part 5)
* fix run!
* fix run!!
* fix run!!!
* fix run!!!!
* fix run!!!!!
* fix run!!!!!!
* add comment about forks
Co-authored-by: GitHub Actions <actions-user@github.com>
Diffstat (limited to 'scripts/notify')
-rwxr-xr-x | scripts/notify/index.js | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/scripts/notify/index.js b/scripts/notify/index.js new file mode 100755 index 000000000..ea911f61a --- /dev/null +++ b/scripts/notify/index.js @@ -0,0 +1,25 @@ +const path = require('path'); +const baseUrl = new URL('https://github.com/withastro/astro/blob/main/'); + +async function run() { + const releases = process.argv.slice(2)[0]; + const data = JSON.parse(releases); + const packages = await Promise.all( + data.map(({ name, version }) => { + const p = path.relative('./', path.dirname(require.resolve(name))).replace(path.sep, '/'); + return { name, version, url: new URL(`${p}/CHANGELOG.md#${version.replace(/\./g, '')}`, baseUrl).toString() }; + }) + ); + + if (packages.length === 1) { + const { name, version, url } = packages[0]; + console.log(`\`${name}@${version}\` was just released! Read the [release notes →](<${url}>)`); + } else { + console.log(`**Some new releases just went out!**\n`); + for (const { name, version, url } of packages) { + console.log(` • \`${name}@${version}\` ([Release Notes →](<${url}>))`); + } + } +} + +run(); |