docs
docs copied to clipboard
[bug] scm capture fails during Github PR workflow
Describe the bug
Not strictly a conan bug, more of an oversight in the documentation but since the Documentation on SCM capture explicitly uses a github workflow as illustration, it's probably worth reporting.
Expected Result
A conanfile using the SCM capture feature should build during a workflow triggered by a Github PR event
Actual Result
Conanfile build fails with
fatal: unable to read tree (cf912fbe1bc5dee48e6117f9a34b60f59a51f578)
See Logs for failing action.
Workaround
Explicitly specify the pull request head ref when checking out the code
- name: Checkout
uses: actions/checkout@v4
with:
ssh-key: ${{ secrets.SSH_PRIVATE_KEY }}
ref: ${{ github.event.pull_request.head.sha }}
How to reproduce it
Clone the repository at https://github.com/planetmarshall/conan-scm-capture.git and create a pull request for the setup-ci branch