From 730bc302ada54436cb35b2721b48d52b00bc5d94 Mon Sep 17 00:00:00 2001 From: Edward Foyle Date: Tue, 2 Apr 2024 14:11:27 -0700 Subject: [PATCH] add git config --- scripts/components/git_commands.ts | 9 +++++++++ scripts/deprecate_release.ts | 3 +++ 2 files changed, 12 insertions(+) diff --git a/scripts/components/git_commands.ts b/scripts/components/git_commands.ts index 997cc6e88e..b9f997aaee 100644 --- a/scripts/components/git_commands.ts +++ b/scripts/components/git_commands.ts @@ -40,3 +40,12 @@ export const getTagsAtCommit = async (commitHash: string) => { const { stdout: tagsString } = await $`git tag --points-at ${commitHash}`; return tagsString.split(EOL).filter((line) => line.trim().length > 0); }; + +/** + * Configure the git user email and name + */ +export const configure = async () => { + // eslint-disable-next-line spellcheck/spell-checker + await $`git config user.email "github-actions[bot]@users.noreply.github.com"`; + await $`git config user.name "github-actions[bot]"`; +}; diff --git a/scripts/deprecate_release.ts b/scripts/deprecate_release.ts index a804ec635d..736268f76e 100644 --- a/scripts/deprecate_release.ts +++ b/scripts/deprecate_release.ts @@ -3,6 +3,7 @@ import { EOL } from 'os'; import { parseArgs } from 'util'; import { commitAllChanges, + configure, getTagsAtCommit, isCleanWorkingTree, push, @@ -140,6 +141,8 @@ const distTag = distTagMatch?.groups?.distTag ?? 'latest'; const prBranch = `restore_release/${previousReleaseCommitHash}`; +await configure(); + await switchToBranch(prBranch); // using checkout instead of restore because we want to restore this directory but not remove files that have been added since