From 5d6a6cb1270fa2cf2e3dcf3302bbdc9e2ce8ddca Mon Sep 17 00:00:00 2001 From: Diego Sampaio Date: Tue, 20 Jun 2023 23:49:25 -0300 Subject: [PATCH] ci(release): setup git user --- packages/release-action/src/gitUtils.ts | 6 ++++++ packages/release-action/src/index.ts | 4 ++++ 2 files changed, 10 insertions(+) create mode 100644 packages/release-action/src/gitUtils.ts diff --git a/packages/release-action/src/gitUtils.ts b/packages/release-action/src/gitUtils.ts new file mode 100644 index 00000000000..0550841f281 --- /dev/null +++ b/packages/release-action/src/gitUtils.ts @@ -0,0 +1,6 @@ +import { exec } from '@actions/exec'; + +export async function setupGitUser() { + await exec('git', ['config', 'user.name', '"rocketchat-github-ci"']); + await exec('git', ['config', 'user.email', '"buildmaster@rocket.chat"']); +} diff --git a/packages/release-action/src/index.ts b/packages/release-action/src/index.ts index 30beae4697f..1e2e446cfa6 100644 --- a/packages/release-action/src/index.ts +++ b/packages/release-action/src/index.ts @@ -6,6 +6,7 @@ import * as core from '@actions/core'; import { publishRelease } from './publishRelease'; import { bumpNextVersion } from './bumpNextVersion'; import { startPatchRelease } from './startPatchRelease'; +import { setupGitUser } from './gitUtils'; // const getOptionalInput = (name: string) => core.getInput(name) || undefined; @@ -22,6 +23,9 @@ import { startPatchRelease } from './startPatchRelease'; // process.chdir(inputCwd); // } + core.info('setting git user'); + await setupGitUser(); + core.info('setting GitHub credentials'); fs.writeFileSync(`${process.env.HOME}/.netrc`, `machine github.com\nlogin github-actions[bot]\npassword ${githubToken}`);