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: set git user when authoring release commit #1385

Merged
merged 1 commit into from
Oct 27, 2023
Merged
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
21 changes: 19 additions & 2 deletions utils/release/git-publish-all.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ import {
gitPublishBranch,
gitSetRefOnCommit,
gitPush,
gitSetupSshRemote,
gitSetupUser,
} from '@coveo/semantic-monorepo-tools';
import {Octokit} from 'octokit';
import {createAppAuth} from '@octokit/auth-app';
Expand All @@ -32,6 +34,19 @@ import {readFileSync, writeFileSync} from 'fs';
import {removeWriteAccessRestrictions} from './lock-master.mjs';
import {spawnSync} from 'child_process';

const setupGit = async () => {
const GIT_USERNAME = 'developer-experience-bot[bot]';
const GIT_EMAIL =
'91079284+developer-experience-bot[bot]@users.noreply.github.com';
const DEPLOY_KEY = process.env.DEPLOY_KEY;
if (DEPLOY_KEY === undefined) {
throw new Error('Deploy key is undefined');
}

await gitSetupUser(GIT_USERNAME, GIT_EMAIL);
await gitSetupSshRemote(REPO_OWNER, REPO_NAME, DEPLOY_KEY, GIT_SSH_REMOTE);
};

/**
* Update usage section at the root readme.
*/
Expand All @@ -43,8 +58,8 @@ function updateRootReadme() {
if (!cliUsage) {
return;
}
rootReadme.replace(usageRegExp, cliUsage);
writeFileSync('README.md', rootReadme);

writeFileSync('README.md', rootReadme.replace(usageRegExp, cliUsage));
}

/**
Expand Down Expand Up @@ -143,6 +158,8 @@ const octokit = new Octokit({
});
//#endregion

await setupGit();

// Define release # andversion
const currentVersionTag = getCurrentVersion(PATH);
currentVersionTag.inc('prerelease');
Expand Down
Loading