Open Rollson opened 9 months ago
Thanks for submitting this @Rollson .
The error comes from resolveSourceContext. It might be helpful if you could help check the subpath of $context and its access?
@JeromeJu Sorry i did not really understand what you asked me to do.
However this is my git folder structure:
.github
app
Dockerfile
index.html
and i specify the path to the dockerfile as --dockerfile="./app/Dockerfile"
Could we check if --context="${{ github.repositoryUrl }}#${{ github.ref }}#${{ github.sha }}"
is set correctly? If so, is this pointing to the correct context?
@JeromeJu i only have this error when i create a PR to my main branch but a push to my feature-branch builds and publishes the image. see context below:
pull event context: --context="git://github.com/my-org/my-repo.git#refs/pull/12/merge#3e...1b7"
push event context: --context="git://github.com/my-org/my-repo.git#refs/heads/my-branch#57...511"
It have been reproduced only github PR.
my actions workflow is below..
on:
pull_request:
branches: [ 'master' ]
...
--context="${{ github.repositoryUrl }}#${{ github.ref }}#${{ github.sha }}"
--verbosity=debug
...
my log is below...
DEBU[0000] Getting source context from git://github.com/my-org/my-repo.git#refs/pull/9/merge#f5f78774abc84b13fe5382238569aa3337e04ca0
DEBU[0000] Getting source from reference refs/pull/9/merge
Enumerating objects: 982, done.
Counting objects: 100% (217/217), done.
Compressing objects: 100% (104/104), done.
Total 982 (delta 117), reused 178 (delta 92), pack-reused 765
Error: error resolving source context: object not found
According to the logs, the checkout from git was successful, but an error occurred when extracting the subPath from the context because the build context location could not be found.
https://github.com/GoogleContainerTools/kaniko/blob/main/cmd/executor/cmd/root.go#L440
Having the same issue here. Can confirm that it only happens on pull_request
events. It works on push
events.
@JeromeJu, hello. please any update on this issue regarding a fix or solution? Thanks
I would also be interested
Also waiting on an update to this as well.
FYI, there is a different way to pass the context in a pull request --context="${{ github.repositoryUrl }}#${{ github.head_ref }}"
FYI, there is a different way to pass the context in a pull request
--context="${{ github.repositoryUrl }}#${{ github.head_ref }}"
This worked for me! Thanks <3
I have workflow file to build and push image to Github Container Registry using Github action. The workflow successfully builds and publishes the container image on a push request, however when i open a PR i have this error after kaniko attempts to download the repo:
my workflow file looks like this:
Any idea on how to fix this error when my workflow is triggered via PR? Thanks