-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
How to checkout current PR branch? #1108
Comments
Added - uses: actions/checkout
with:
ref: ${{ github.ref }}
fetch-depth: 0 Now the checkout gets slightly further but results in: Determining the checkout info
/usr/bin/git branch --list --remote origin/prettier-lint-md-workflow
/usr/bin/git tag --list prettier-lint-md-workflow
Error: A branch or tag with the name 'prettier-lint-md-workflow' could not be found https://github.com/google/osv-scanner/actions/runs/3914653689/jobs/6691959309 |
Tried fatal: You are not currently on a branch.
To push the history leading to the current (detached HEAD)
state now, use
git push origin HEAD:<name-of-remote-branch> 😟 |
I think you need to use this: Just found your issue because I have the following error when someone makes a PR from a cloned repo.
I'm actually also using Prettier. I have this config.
Maybe our problem is related. This is the run which fails: https://github.com/0ptim/DeFiChainWiki/actions/runs/4108092834/jobs/7088370243 |
Just got it working! 🎉 |
I am trying to create a PR workflow that checkouts out the PR branch, lints the markdown, and then makes a commit with the changes (on PR: google/osv-scanner#144).
This is running on the PR branch that is introducing this workflow, which is coming from my fork of this repo.
I am not understanding how to properly checkout the PR branch.
Looking at #20, and the docs for the Prettier action I am using for linting, it seems I should just
But using this causes checkout to fail, see job: https://github.com/google/osv-scanner/actions/runs/3914565858/jobs/6691777605
My git-fu 🥷 isn't strong enough to figure out what is wrong here
The text was updated successfully, but these errors were encountered: