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

fix: I encountered an 'unknown revision' error in GitHub Actions. #4159

Open
1 of 4 tasks
MatthieuLeterme opened this issue Sep 20, 2024 · 0 comments
Open
1 of 4 tasks
Labels

Comments

@MatthieuLeterme
Copy link

Steps to Reproduce

steps:
      - uses: actions/checkout@v4
      - uses: pnpm/action-setup@v3
        name: Install pnpm
        with:
          version: 8
          run_install: false
      - name: Print versions
        run: |
          git --version
          node --version
          pnpm --version
          pnpm dlx commitlint --version
      - name: Install commitlint
        run: |
          pnpm install

      - name: Validate PR commits with commitlint
        if: github.event_name == 'pull_request'
        run: pnpm dlx commitlint --from ${{ github.event.pull_request.head.sha }}~${{ github.event.pull_request.commits }} --to ${{ github.event.pull_request.head.sha }} --verbose

Current Behavior

Error: fatal: ambiguous argument '<head_sha>~<commits_number_in_pr>..<head_sha>': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'

    at Transform.transform [as _transform] (/home/runner/setup-pnpm/node_modules/.bin/store/v3/tmp/dlx-[17](https://github.com/matchersteam/poc-bo-v3/actions/runs/10959823335/job/30433008152#step:6:18)49/node_modules/.pnpm/[email protected]/node_modules/git-raw-commits/index.js:100:36)

Expected Behavior

<commit_message>
Good | Error

Affected packages

  • cli
  • core
  • prompt
  • config-angular

Possible Solution

No response

Context

I want to check the lint of commits in all pull requests in my repository

commitlint --version

19.5.0

git --version

2.46.0

node --version

v18.20.4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

1 participant