git-auto-commit-action: Fatal error when auto-commit
Hello,
I tried to use your action but it doesn’t work, I have a fatal error at the end.
Run stefanzweifel/git-auto-commit-action@v1.0.0
env:
GITHUB_TOKEN: ***
COMMIT_MESSAGE: hello
COMMIT_AUTHOR_NAME: CS Fixer
COMMIT_AUTHOR_EMAIL: john.doe@example.com
/usr/bin/docker run --name b3e3f72439fc3af08948f989a19a825463598a_d79f18 --label b3e3f7 --workdir /github/workspace --rm -e GITHUB_TOKEN -e COMMIT_MESSAGE -e COMMIT_AUTHOR_NAME -e COMMIT_AUTHOR_EMAIL -e HOME -e GITHUB_REF -e GITHUB_SHA -e GITHUB_REPOSITORY -e GITHUB_ACTOR -e GITHUB_WORKFLOW -e GITHUB_HEAD_REF -e GITHUB_BASE_REF -e GITHUB_EVENT_NAME -e GITHUB_WORKSPACE -e GITHUB_ACTION -e GITHUB_EVENT_PATH -e RUNNER_OS -e RUNNER_TOOL_CACHE -e RUNNER_TEMP -e RUNNER_WORKSPACE -v "/var/run/docker.sock":"/var/run/docker.sock" -v "/home/runner/work/_temp/_github_home":"/github/home" -v "/home/runner/work/_temp/_github_workflow":"/github/workflow" -v "/home/runner/work/php-mime-mail-parser/php-mime-mail-parser":"/github/workspace" b3e3f7:2439fc3af08948f989a19a825463598a
HEAD detached at 8866c5a
Changes to be committed:
(use "git reset HEAD <file>..." to unstage)
new file: build/logs/clover.xml
new file: test.log
[detached HEAD 84cac5b] hello
Author: CS Fixer <john.doe@example.com>
2 files changed, 515 insertions(+)
create mode 100644 build/logs/clover.xml
create mode 100644 test.log
fatal: could not read Username for 'https://github.com': No such device or address
##[error]Docker run failed with exit code 128
FYI my step action:
- name: Auto Commit changed files
uses: stefanzweifel/git-auto-commit-action@v1.0.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COMMIT_MESSAGE: "hello"
COMMIT_AUTHOR_NAME: "CS Fixer"
COMMIT_AUTHOR_EMAIL: "john.doe@example.com"
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Reactions: 5
- Comments: 19 (11 by maintainers)
Commits related to this issue
- Add GITHUB_TOKEN to survey-health.yml As described in https://github.com/stefanzweifel/git-auto-commit-action/issues/2#issuecomment-599721261 and referencing: https://help.github.com/en/actions/conf... — committed to ProjectDrawdown/solutions by DentonGentry 4 years ago
- :green_heart: Use GH PAT https://github.com/stefanzweifel/git-auto-commit-action/issues/2#issuecomment-599721261 — committed to AnandChowdhary/firebase-github-backup by AnandChowdhary 4 years ago
- :green_heart: Use GH PAT https://github.com/stefanzweifel/git-auto-commit-action/issues/2#issuecomment-599721261 — committed to AnandChowdhary/firebase-github-backup by AnandChowdhary 4 years ago
- chore(workflow_linting): moved token permissions to checkout step as this is supposedly the correct way to do it according to https://github.com/stefanzweifel/git-auto-commit-action/issues/2#issuecomm... — committed to datarootsio/rootsstyle by deleted user 3 years ago
v2.0.0 of this Action has been released which fixes this issue. https://github.com/stefanzweifel/git-auto-commit-action/releases/tag/v2.0.0
I’ve recently stumbled upon this action by another developer. Instead of setting the remote url through
git remote set-url, the Action authenticates itself with GitHub through the.netrc-file.I’ve tested this in my test-projects, and everything seems to work as intended. As the Action still uses the
GITHUB_TOKEN-secret, no new workflow is triggered by the pushed commit.Please checkout the updated README on how to use Action in your workflows.
@eXorus concerning triggering and pushing to a forked repo: I read in a forum thread or in an issue, that the Actions of a fork are actually run on the fork and not on the main repository. Otherwise the fork could read secrets from the main repository through actions.
Does this latest version work for your setup?
I’m closing this issue now, as the main error (“fatal: could not read Username for ‘https://github.com’: No such device or address”) has been fixed.
and the reason was that the one repo was on actions/checkout@v1, and the other @v2.
@localheinz Since v3.0.0 the Action no longer requires a token in the Action itself. You would have to pass the token to the
actions/checkout@v2step, like this:This Action no longer does any authentication with GitHub itself. We just use whatever the
actions/checkout-Action does.I tried this last version and it’s working 🎉 Many thanks!