Clarification about "working with any ref" changes
See original GitHub issue👋 First off, thank you for this action (it’s a huge help)
I was updating my repo to the latest version v8 because I wanted to take advantage of
now work with whatever ref has been checked out, without pulling or switching branches by default.
In my workflow on a pull_request
event I simply use the default option with actions/checkout@v2
here
However this fails https://github.com/prince-chrismc/label-merge-conflicts-action/runs/4892752781?check_suite_focus=true#step:8:79 with fatal: You are not currently on a branch.
My use case is very similar to the example https://github.com/EndBug/add-and-commit#automated-linting just a different event 🤔
Do you have any suggestion or ideas to help me debug this issue?
Thanks in advance ❤️
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:8 (6 by maintainers)
Top Results From Across the Web
when a reference changes their mind, advice for new ...
Here we go... 1. When a reference changes their mind about what they'll say. ... My interview, references, and first week were all...
Read more >Job References: What If Former Bosses Don't Work There ...
Even part-time for summer jobs I had, either the former supervisor is no longer around, the company changed names, or the company is...
Read more >2022 Rules Changes and Points of Clarification
The rule change from last year is now permanent. During a free kick, all receiving team players must be inbounds and behind their...
Read more >Forwarding Refs
Ref forwarding is an opt-in feature that lets some components take a ref they receive, and pass it further down (in other words,...
Read more >GitLab CI run Job only refs AND changes
I want to run Job only for merge_requests refs AND when changes for specified files, according to official doc i create this Job...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hi, thanks for using the action!
By default
actions/checkout
creates a detached head state when the run is triggered by apull_request
event. If you want to commit to the head branch you would need to checkout the branch the PR is coming from in the head repo.I would set it up like this:
You can find the full docs for payloads of
pull_request
events here.If you’re planning on running this only on “internal” PRs then you could omit the
repository
input. If you’re planning to use this with PRs coming from other forks, please keep in mind that you might not have write access to that repo. You can try setting up the repo with your PAT, but honestly, I’ve never tried.PS: I see that your workflow runs on both
pull_request
events and other ones: since this “custom checkout” is meant only for PRs, you could try having it run only forpull_request
events, while other ones will trigger the usual checkout. If you wish to do so, you can use thestep.if
property, here’s the docs.Anyway, I think this is something worthy of putting in the FAQ section of the README, since other people might want to use the action in this scenario.
I hope this solves your issue!
This fix has been published in
v8.0.1
(alsov8
andlatest
). Thanks again for your contribution ❤️