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

git branch error: unknown option show-current #88

Open
alrf opened this issue May 20, 2021 · 4 comments
Open

git branch error: unknown option show-current #88

alrf opened this issue May 20, 2021 · 4 comments

Comments

@alrf
Copy link

alrf commented May 20, 2021

Pipeline fails with:

Run dorny/paths-filter@v2.10.1
Get current git ref
  /usr/bin/git branch --show-current
  error: unknown option `show-current'

const branch = (await exec('git', ['branch', '--show-current'])).stdout.trim()

git version 2.20.1 is used.

The same issue as for actions/checkout: actions/checkout#121

@balazsorban44
Copy link

We get a similar issue:

Get current git ref
/usr/bin/git branch --show-current
fatal: not a git repository (or any of the parent directories): .git
Error: The process '/usr/bin/git' failed with exit code 128

See: https://github.com/nextauthjs/adapters/runs/2645738825

@dorny
Copy link
Owner

dorny commented May 24, 2021

@alrf: Thanks for reporting the issue. I will use the same workaround as they used in the checkout action.

@dorny
Copy link
Owner

dorny commented May 24, 2021

@balazsorban44: The error you get is not related to this issue. You are using paths-filter in a workflow triggered by push event. In this case, you have to use the checkout@v2 step before paths-filter. Without checkout it works only for workflows triggered by a pull request event.

jackgerrits added a commit to VowpalWabbit/vowpal_wabbit that referenced this issue Mar 9, 2022
jackgerrits added a commit to VowpalWabbit/vowpal_wabbit that referenced this issue Mar 12, 2022
* fix: path filter requires checkout v2

dorny/paths-filter#88 (comment)

* Update valgrind.yml

* Update valgrind.yml

* Update valgrind.yml

* Update valgrind.yml

* Update valgrind.yml
hanatgit added a commit to sillsdev/webonary that referenced this issue Jul 11, 2022
@scottwn
Copy link

scottwn commented Jul 27, 2022

We're seeing the same show-current error on certain buster and centos images using checkout@v3
https://github.com/AgnostiqHQ/covalent/runs/7530228427

jcfr added a commit to jcfr/Slicer that referenced this issue Jul 1, 2023
This commit is a follow-up of 2d6d136 (ENH: Skip steps in required job
rather than skipping workflow) that should ensure the "dorny/paths-filter"
action works in the context of push event.

See dorny/paths-filter#88 (comment)
jcfr added a commit to Slicer/Slicer that referenced this issue Jul 1, 2023
This commit is a follow-up of 2d6d136 (ENH: Skip steps in required job
rather than skipping workflow) that should ensure the "dorny/paths-filter"
action works in the context of push event.

See dorny/paths-filter#88 (comment)
streambinder added a commit to streambinder/spotitube that referenced this issue Jul 28, 2023
streambinder added a commit to streambinder/spotitube that referenced this issue Jul 28, 2023
smaye81 added a commit to connectrpc/examples-es that referenced this issue Aug 15, 2023
This fixes two issues on CI with `paths-filter`:

1. Perform a checkout prior to the step. For more info, see this issue:
dorny/paths-filter#88
2. Only perform CI step if there are prior changes. For more info, see
dorny/paths-filter#66
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

4 participants