You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Run git log --all --pretty=oneline --abbrev-commit --boundary --left-right main...test >> pstest.txt
git log --all --pretty=oneline --abbrev-commit --boundary --left-right main...test >> pstest.txt
shell: C:\Program Files\PowerShell\7\pwsh.EXE -command ". '{0}'"##[debug]C:\Program Files\PowerShell\7\pwsh.EXE -command ". 'D:\a\_temp\d7231df4-e480-472a-9f67-420c04c007d6.ps1'"
fatal: ambiguous argument 'main...test': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
Error: Process completed with exit code 1.
Run # git log --all --pretty=oneline --abbrev-commit --boundary --left-right main...test -- >> pstest.txt# git log --all --pretty=oneline --abbrev-commit --boundary --left-right main...test -- >> pstest.txt
git log test
shell: C:\Program Files\PowerShell\[7](https://github.com/ee090186/GitHubActionsTest/actions/runs/4460168081/jobs/7833133731?pr=2#step:4:8)\pwsh.EXE -command ". '{0}'"
fatal: ambiguous argument 'test': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
Only a single commit is fetched by default, for the ref/SHA that triggered the workflow.
Set fetch-depth: 0 to fetch all history for all branches and tags.
Refer here to learn which commit $GITHUB_SHA points to for different events.
What happened?
ローカル環境では成功する以下のgit logコマンドが、Github Actions内で実行するとエラーになる
Relevant log output
git log -5
コマンドにすると、コマンドは実行できるが、このGitHubActionsTest
リポジトリには存在しない?sha
が表示されたgit log test
のコマンド実行時→このコマンドもエラーのため、
git log
コマンド自体よりもその前のgit設定などの部分に問題あるかも以下の
git config
ステップをコメントアウトしてみてもエラー変わらず-> この設定ステップには問題なし
Cause
fetch-depth: 0
を指定していなかったためデフォルトだと一つのコミットしか参照できないよう
actions/checkout@v3
actions/checkout
では、ランナーはGithub
からリポジトリをクローンしてきている状態のため、リモート追跡ブランチ(origin/{ブランチ名}
)しかないから?Solution
fetch-depth: 0
を指定するorigin/
を記載し、リモート追跡ブランチを指定する実行結果
Refelence
以下のIssue・プルリクエストでは、同様なエラーが起き、
v1
を使用する必要があると書いてあるように見えたが。。。acthons/checkout@main
でも動作したThe text was updated successfully, but these errors were encountered: