Skip to content
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

show-ref can't handle HEAD^ #252

Open
vlinder opened this issue Oct 31, 2024 · 0 comments
Open

show-ref can't handle HEAD^ #252

vlinder opened this issue Oct 31, 2024 · 0 comments

Comments

@vlinder
Copy link

vlinder commented Oct 31, 2024

Would it be possible for the action to switch from show-ref to rev-parse. It works with more ways of specifying commits. Like HEAD^.

git show-ref HEAD^ # fails
git rev-parse HEAD^ # works

Slightly redacted log from merge_group run.

Get current git ref
  /usr/bin/git branch --show-current
  gh-readonly-queue/main/pr-7725-77a9b0
Changes will be detected between HEAD^ and gh-readonly-queue/main/pr-7725-77a9b0
Searching for merge-base HEAD^...gh-readonly-queue/main/pr-7725-77a9b0
  /usr/bin/git show-ref HEAD^
  /usr/bin/git show-ref gh-readonly-queue/main/pr-7725-77a9b0
  9d2a3c[45](https://github.com/<redacted>)ac3313452 refs/heads/gh-readonly-queue/main/pr-7725-77a9b0
  9d2a3c refs/remotes/origin/gh-readonly-queue/main/pr-7725-77a9b0
  /usr/bin/git fetch --no-tags --depth=100 origin HEAD^ gh-readonly-queue/main/pr-7725-77a9b0
  fatal: invalid refspec 'HEAD^'

Using rev-parse would open up use cases like the following:

-      - name: Determine base
-        id: determine_base
-        run: echo "BASE=$(git rev-parse HEAD^1)" >> $GITHUB_OUTPUT
       - uses: dorny/paths-filter
         id: changes
         with:
-          base: ${{ steps.determine_base.outputs.BASE }}
+          base: HEAD^
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant