我正在尝试预先提交我的 PR 中的更改,但我收到以下错误:
pre-commit run: error: argument --from-ref/--source/-s: expected one argument
我该如何解决这个问题?.
我在这里看到了类似的问题选择所有具有特定扩展名的文件 Github 操作工作流程 并按照那里的步骤操作,但我的结果没有结果。这是预提交的文档这是sqlfluff的文档
这是我工作流程中的 yml 文件:
`
name: linter
on:
pull_request:
jobs:
lint:
runs-on: ubuntu-latest
permissions:
# Give the default GITHUB_TOKEN write permission to commit and push the
# added or changed files to the repository.
contents: write
steps:
- uses: actions/checkout@v3
with:
# requites to grab the history of the PR
fetch-depth: 0
continue-on-error: true
- uses: actions/setup-python@v3
continue-on-error: true
- uses: pre-commit/[email protected]
with:
extra_args: --color=always --from-ref ${{ github.event.pull_request.base.sha }} --to-ref ${{ github.event.pull_request.head.sha }}
continue-on-error: true
- uses: stefanzweifel/git-auto-commit-action@v4`
这是我的
.pre-commit-config.yaml
文件:
name: linter
on:
pull_request:
jobs:
lint:
runs-on: ubuntu-latest
permissions:
# Give the default GITHUB_TOKEN write permission to commit and push the
# added or changed files to the repository.
contents: write
steps:
- uses: actions/checkout@v3
with:
# requites to grab the history of the PR
fetch-depth: 0
continue-on-error: true
- uses: actions/setup-python@v3
continue-on-error: true
- uses: pre-commit/[email protected]
with:
extra_args: --color=always --from-ref ${{ github.event.pull_request.base.sha }} --to-ref ${{ github.event.pull_request.head.sha }}
continue-on-error: true
- uses: stefanzweifel/git-auto-commit-action@v4