-
-
Notifications
You must be signed in to change notification settings - Fork 434
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
Git config seems to be empty - Please tell me who you are. #2244
Comments
Hi @chris-kt Apologies for the slow response. I guess git needs to have global config set before some commands will work. You could try adding these lines in a workflow step before the action runs. I don't think it matters much what email or name you use because the action should override them anyway.
|
Roger that, I'll give it a go. Thanks for the reply! |
This ended up working, however, the user config does NOT get overridden by the action. So, the PR is opened with my username and email set in this step. I guess that's okay, but it's not what I would expect. Lastly, I get an unexpected result of the PR containing a file names The meaningful portion of my workflow file is as follows: - name: NPM Audit fix
run: npm audit fix
- name: Create Pull Request
uses: peter-evans/create-pull-request@v5
with:
token: ${{ secrets.PAT }}
base: ${{ github.head_ref }}
branch: feature/update-dependencies
commit-message: Updates dependencies
labels: auto-pr, dependency-audit
title: NOJIRA | github | NPM Audit Update
body: |
# Dependency updates via `npm audit fix`
This has been auto-generated. The body/title of the PR are correct, but when you look at the files inside of the pull request, we see a single file named 'results' with the following: { "permission": "admin", "user": { "login": "chris-kt", "id": 77807819, "node_id": "MDQ6VXNlcjc3ODA3ODE5", "avatar_url": "https://avatars.githubusercontent.com/u/77807819?v=4", "gravatar_id": "", "url": "https://api.github.com/users/chris-kt", "html_url": "https://github.com/chris-kt", "followers_url": "https://api.github.com/users/chris-kt/followers", "following_url": "https://api.github.com/users/chris-kt/following{/other_user}", "gists_url": "https://api.github.com/users/chris-kt/gists{/gist_id}", "starred_url": "https://api.github.com/users/chris-kt/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/chris-kt/subscriptions", "organizations_url": "https://api.github.com/users/chris-kt/orgs", "repos_url": "https://api.github.com/users/chris-kt/repos", "events_url": "https://api.github.com/users/chris-kt/events{/privacy}", "received_events_url": "https://api.github.com/users/chris-kt/received_events", "type": "User", "site_admin": false, "permissions": { "admin": true, "maintain": true, "push": true, "triage": true, "pull": true }, "role_name": "admin" }, "role_name": "admin" } I feel like I must be doing something wrong here, but am unsure what it would be. |
Please check the inputs here. You can override the defaults for
Fairly sure that |
Git config seems to be empty - Please tell me who you are.
Output
ISSUE
Issue is outlined above - seems like when the PR is ready to be created, Git doesn't know who the actor is.
Workflow file
Steps to reproduce
May be difficult to reproduce as I'm behind a corporate proxy using self-hosted runners and custom images.
If this issue is describing a possible bug please provide (or link to) your GitHub Actions workflow.
The text was updated successfully, but these errors were encountered: