Skip to content

fix: pre-commit in workflows need to compare against origin/HEAD #616

@NickLarsenNZ

Description

@NickLarsenNZ

Currently the pre-commit checks are not picking up problems, because it is skipping all checks in CI

Image

As @Techassi found in the docs: https://pre-commit.com/#usage-in-continuous-integration, it needs to be run with extra options:

# pre-commit run --from-ref origin/HEAD --to-ref HEAD
pre-commit run --from-ref ${{ github.event.pull_request.base.sha }} --to-ref ${{ github.event.pull_request.head.sha }}

For each fix, do the following:

  • Run pre-commit with --from-ref origin/HEAD --to-ref HEAD
  • Pin the hooks to commits (replace rev tags with commit hashes like we do in github actions)
### Repositories that need fixing
- [ ] https://github.com/stackabletech/docker-images/pull/790
- [ ] docker-images pre-commit hook pinning
- [ ] operator-templating
- [ ] stackable-cockpit

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions