Skip to content

Filter out repositories with .batchignore at root

Warren Gifford requested to merge mrn/batchignore-repo-root into main

Created by: mrnugget

This implements https://github.com/sourcegraph/sourcegraph/issues/18330 by querying the locations of .batchignore files in each repository yielded by the on attribute in a batch spec. If locations were found, the repository is ignored.

This can be overwritten by using the -force-override-ignore flag.

Example: given my instance has the following repositories:

  • github.com/sourcegraph-testing/zap
  • github.com/sourcegraph-testing/titan
  • github.com/sourcegraph-testing/tidb
  • github.com/sourcegraph-testing/etcd
  • github.com/sourcegraph-testing/batch-changes-testing-ignore

And I use the following batch spec:

on:
  - repositoriesMatchingQuery: repohasfile:README.md repo:sourcegraph-testing

steps:
  - run: echo "a horse says 'hello'" >> README.md
    container: alpine:3

with this change the batch-changes-testing-ignore repository will be ignored:

  • no archive will be downloaded
  • no steps executed

A message is printed that says it's ignored.

Merge request reports

Loading