Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(): Show the correct header in slack bot if it's a beta or alpha release #2914

Merged
merged 1 commit into from
Mar 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .changeset/ten-dryers-sniff.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
---
17 changes: 14 additions & 3 deletions scripts/notify.mjs
Original file line number Diff line number Diff line change
@@ -1,11 +1,21 @@
import { fileURLToPath } from 'node:url';
import {fileURLToPath} from 'node:url';

import fs from 'fs-extra';
import { globby as glob } from 'globby';
import {globby as glob} from 'globby';

const { GITHUB_REF = 'main' } = process.env;
const baseUrl = new URL(`https://github.com/clerk/javascript/blob/${GITHUB_REF}/`);

const getReleaseChannel = (version) => {
if (version?.includes('alpha')) {
return 'Alpha';
} else if (version?.includes('beta')) {
return 'Beta';
} else {
return 'Stable';
}
};

/**
* @typedef {Object} PackageData
* @property {string} name
Expand Down Expand Up @@ -52,7 +62,8 @@ const slackFormatter = {
});
const blocks = [];

blocks.push(header(`Javascript SDKs - Stable Release - ${new Date().toLocaleDateString('en-US')}`));
const releaseChannel = getReleaseChannel(packageData?.[0]?.version);
blocks.push(header(`Javascript SDKs - ${releaseChannel} Release - ${new Date().toLocaleDateString('en-US')}`));

let body = '';
for (const { name, version, changelogUrl } of packageData) {
Expand Down
Loading