From b182d31e704c00fe910e580acf06f590e70d61e7 Mon Sep 17 00:00:00 2001 From: Louis Bompart Date: Fri, 27 Oct 2023 03:22:01 -0400 Subject: [PATCH] chore: ignore the snap dep pipeline kthx --- utils/release/git-publish-all.mjs | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/utils/release/git-publish-all.mjs b/utils/release/git-publish-all.mjs index 898b408908..0487622894 100755 --- a/utils/release/git-publish-all.mjs +++ b/utils/release/git-publish-all.mjs @@ -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'; @@ -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. */ @@ -43,8 +58,8 @@ function updateRootReadme() { if (!cliUsage) { return; } - rootReadme.replace(usageRegExp, cliUsage); - writeFileSync('README.md', rootReadme); + + writeFileSync('README.md', rootReadme.replace(usageRegExp, cliUsage)); } /** @@ -143,6 +158,8 @@ const octokit = new Octokit({ }); //#endregion +await setupGit(); + // Define release # andversion const currentVersionTag = getCurrentVersion(PATH); currentVersionTag.inc('prerelease'); @@ -190,6 +207,7 @@ const commitMessage = dedent` **/README.md **/CHANGELOG.md **/package.json + **/*.snap README.md CHANGELOG.md package.json