Git config--global user.email=";email@example.com&引用;GitHub操作中的和user.name错误

Git config--global user.email=";email@example.com&引用;GitHub操作中的和user.name错误,git,github-actions,Git,Github Actions,我正在尝试为react项目创建GitHub操作。基本上,我希望操作执行两个步骤: 1. npm安装 2. npm运行部署 但我的操作运行在上失败 Git config--global user.email=”email@example.com“和Git config--global user.name” npm run deploy命令执行的功能包括git add、git commit和git push,因此我需要以某种方式将适当的凭据传递给操作,以允许执行这些命令。有人知道我如何做到这一点吗?

我正在尝试为react项目创建GitHub操作。基本上,我希望操作执行两个步骤:
1. <代码>npm安装
2. <代码>npm运行部署
但我的操作运行在上失败
Git config--global user.email=”email@example.com“
Git config--global user.name”


npm run deploy
命令执行的功能包括
git add
git commit
git push
,因此我需要以某种方式将适当的凭据传递给操作,以允许执行这些命令。有人知道我如何做到这一点吗?

如果您试图设置电子邮件和用户,可以使用以下两种方法之一:

import { context } from '@actions/github';

await exec(`git config --local user.name "${context.actor}"`);
await exec(`git config --local user.email "github-action-${context.actor}@users.noreply.github.com"`); // This is basically a bogus email, but you get the idea


正如我在上面的评论中所描述的,每种方法都有优点和缺点。

如果您试图设置电子邮件和用户,您可以使用以下两种方法之一:

import { context } from '@actions/github';

await exec(`git config --local user.name "${context.actor}"`);
await exec(`git config --local user.email "github-action-${context.actor}@users.noreply.github.com"`); // This is basically a bogus email, but you get the idea


正如我在上面的评论中所描述的,每种方法都有优点和缺点。

git
都是小写的,您不需要在
user.email
之前使用
=
,而另一个comand您应该在这里使用您的名字作为
git config--global user.name”“
。该git消息是我从操作中收到的错误,而不是命令。请先运行
git config--list--global
检查存储的这些值?
git
都是小写的,您不需要
=
user.email
之前。另一个comand您应该使用as
git config--global user.name“Your name here”
。该git消息是我从操作中收到的错误,而不是命令,您可以先运行
git config--list--global
来检查存储的值吗?