checkout@v2 doesn't allow `git diff origin/master`
Open
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 8.9k
- Forks
- 2.8k
- PR merge metrics
- No merged PRs in 30d
Description
Hi, I have such a step in my actions config:
name: Get list of changed files
id: changed_files
run: |
list=`git diff --name-only origin/master HEAD`
echo $list
echo "::set-output name=list::$list"
shell: bash
When using checkout@v1 it works, while with checkout@v2 I get
fatal: ambiguous argument 'origin/master': unknown revision or path not in the working tree.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the checkout@v2 workflow using the shown action configuration, then run the reported git diff --name-only origin/master HEAD command in the checked-out workspace. Trace how checkout@v2 fetches and names refs, and verify the fix by confirming that origin/master resolves and the command lists changed files.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- git, github-actions, typescript
- Domain
- ci-cd, devops
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100