diff --git a/.dockerignore b/.dockerignore
index df9a858..c50c42d 100644
--- a/.dockerignore
+++ b/.dockerignore
@@ -1,5 +1,5 @@
# Ignore everything
-**
+#**
# Allow binary
-!/codeowners-validator
+#!/codeowners-validator
diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md
index 82acc7c..9bb7bd4 100644
--- a/.github/ISSUE_TEMPLATE/bug_report.md
+++ b/.github/ISSUE_TEMPLATE/bug_report.md
@@ -3,7 +3,7 @@ name: Bug report
about: Report a bug in the project
title: ''
labels: bug
-assignees: mszostok
+assignees: stitchfix
---
diff --git a/.goreleaser.yml b/.goreleaser.yml
index 3d134eb..c3f0636 100644
--- a/.goreleaser.yml
+++ b/.goreleaser.yml
@@ -12,7 +12,7 @@ builds:
- amd64
- 386
ldflags:
- - -s -w -X github.com/mszostok/codeowners-validator/pkg/version.version={{.Version}} -X github.com/mszostok/codeowners-validator/pkg/version.commit={{.ShortCommit}} -X github.com/mszostok/codeowners-validator/pkg/version.buildDate={{.Date}}
+ - -s -w -X github.com/stitchfix/codeowners-validator/pkg/version.version={{.Version}} -X github.com/stitchfix/codeowners-validator/pkg/version.commit={{.ShortCommit}} -X github.com/stitchfix/codeowners-validator/pkg/version.buildDate={{.Date}}
# List of combinations of GOOS + GOARCH + GOARM to ignore.
# Default is empty.
ignore:
@@ -44,6 +44,6 @@ dockers:
binaries:
- codeowners-validator
image_templates:
- - "mszostok/codeowners-validator:latest"
- - "mszostok/codeowners-validator:{{ .Tag }}"
- - "mszostok/codeowners-validator:v{{ .Major }}.{{ .Minor }}"
+ - "stitchfix/codeowners-validator:latest"
+ - "stitchfix/codeowners-validator:{{ .Tag }}"
+ - "stitchfix/codeowners-validator:v{{ .Major }}.{{ .Minor }}"
diff --git a/Dockerfile b/Dockerfile
index e263062..3f8f8bb 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,19 +1,20 @@
# Get latest CA certs & git
-FROM alpine:3.14.2 as deps
+FROM ubuntu:18.04 as deps
-# hadolint ignore=DL3018
-RUN apk --no-cache add ca-certificates git
+RUN apt update
+RUN apt install -y git
FROM scratch
-LABEL source=https://github.com/mszostok/codeowners-validator.git
+LABEL source=https://github.com/stitchfix/codeowners-validator.git
-COPY ./codeowners-validator /codeowners-validator
+COPY ./bin/codeowners-validator /codeowners-validator
COPY --from=deps /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
COPY --from=deps /usr/bin/git /usr/bin/git
COPY --from=deps /usr/bin/xargs /usr/bin/xargs
COPY --from=deps /lib /lib
COPY --from=deps /usr/lib /usr/lib
+COPY --from=deps /usr/bin/tail /usr/bin/tail
CMD ["/codeowners-validator"]
diff --git a/README.md b/README.md
index fd06457..c0a85d8 100644
--- a/README.md
+++ b/README.md
@@ -11,7 +11,7 @@
## Codeowners Validator
-
+
The Codeowners Validator project validates the GitHub [CODEOWNERS](https://help.github.com/articles/about-code-owners/) file based on [specified checks](#checks). It supports public and private GitHub repositories and also GitHub Enterprise installations.
@@ -29,7 +29,7 @@ docker run --rm -v $(pwd):/repo -w /repo \
-e GITHUB_ACCESS_TOKEN="$GH_TOKEN" \
-e EXPERIMENTAL_CHECKS="notowned" \
-e OWNER_CHECKER_REPOSITORY="org-name/rep-name" \
- mszostok/codeowners-validator:v0.6.0
+ stitchfix/codeowners-validator:v0.6.0
```
#### Command line
@@ -46,7 +46,7 @@ env REPOSITORY_PATH="." \
#### GitHub Action
```yaml
-- uses: mszostok/codeowners-validator@v0.6.0
+- uses: stitchfix/codeowners-validator@v0.6.0
with:
checks: "files,owners,duppatterns"
experimental_checks: "notowned"
@@ -62,7 +62,7 @@ Check the [Configuration](#configuration) section for more info on how to enable
## Installation
-It's highly recommended to install a fixed version of `codeowners-validator`. Releases are available on the [releases page](https://github.com/mszostok/codeowners-validator/releases).
+It's highly recommended to install a fixed version of `codeowners-validator`. Releases are available on the [releases page](https://github.com/stitchfix/codeowners-validator/releases).
#### From Release
@@ -70,23 +70,23 @@ Here is the recommended way to install `codeowners-validator`:
```bash
# binary installed into ./bin/
-curl -sfL https://raw.githubusercontent.com/mszostok/codeowners-validator/main/install.sh | sh -s v0.6.0
+curl -sfL https://raw.githubusercontent.com/stitchfix/codeowners-validator/main/install.sh | sh -s v0.6.0
# binary installed into $(go env GOPATH)/bin/codeowners-validator
-curl -sfL https://raw.githubusercontent.com/mszostok/codeowners-validator/main/install.sh | sh -s -- -b $(go env GOPATH)/bin v0.6.0
+curl -sfL https://raw.githubusercontent.com/stitchfix/codeowners-validator/main/install.sh | sh -s -- -b $(go env GOPATH)/bin v0.6.0
# In alpine linux (as it does not come with curl by default)
-wget -O - -q https://raw.githubusercontent.com/mszostok/codeowners-validator/main/install.sh | sh -s v0.6.0
+wget -O - -q https://raw.githubusercontent.com/stitchfix/codeowners-validator/main/install.sh | sh -s v0.6.0
# Print version. Add `--short` to print just the version number.
codeowners-validator -v
```
-You can also download [latest version](https://github.com/mszostok/codeowners-validator/releases/latest) from release page manually.
+You can also download [latest version](https://github.com/stitchfix/codeowners-validator/releases/latest) from release page manually.
#### From Sources
-You can install `codeowners-validator` with `go install github.com/mszostok/codeowners-validator@v0.6.0`.
+You can install `codeowners-validator` with `go install github.com/stitchfix/codeowners-validator@v0.6.0`.
> NOTE: please use Go 1.16 or greater.
@@ -148,6 +148,6 @@ Contributions are greatly appreciated! The project follows the typical GitHub pu
## Roadmap
-The [codeowners-validator roadmap uses Github milestones](https://github.com/mszostok/codeowners-validator/milestone/1) to track the progress of the project.
+The [codeowners-validator roadmap uses Github milestones](https://github.com/stitchfix/codeowners-validator/milestone/1) to track the progress of the project.
They are sorted with priority. First are most important.
diff --git a/action.yml b/action.yml
index 3d04fc8..533fb02 100644
--- a/action.yml
+++ b/action.yml
@@ -47,12 +47,13 @@ inputs:
description: "The comma-separated list of owners that should not be validated. Example: @owner1,@owner2,@org/team1,example@email.com."
required: false
-runs:
- using: 'docker'
- image: 'docker://mszostok/codeowners-validator:v0.6.0'
- env:
- ENVS_PREFIX: "INPUT"
-
-branding:
- icon: "shield"
- color: "gray-dark"
+# runs:
+# using: 'docker'
+# image: 'docker://histhing'
+
+# env:
+# ENVS_PREFIX: "INPUT"
+# #TODO: build container separately, make new action that just uses the image.
+# branding:
+# icon: "shield"
+# color: "gray-dark"
diff --git a/docs/assets/usage.svg b/docs/assets/usage.svg
index 687ed61..3b1cdca 100644
--- a/docs/assets/usage.svg
+++ b/docs/assets/usage.svg
@@ -1 +1 @@
-
+OWNER_CHECKER_ORGANIZATION_NAME="gh-codeowners"\▲▲#Downloadcodeowners-validatorbinary/binv0.2.0▲curl-sfLhttps://raw.githubusercontent.com/stitchfix/codeowners-validator/main/install.sh|sh-s---b/usr/local/binv0.2.0stitchfix/codeowners-validatorinfocheckingGitHubfortag'v0.2.0'stitchfix/codeowners-validatorinfofoundversion:0.2.0forv0.2.0/Darwin/x86_64stitchfix/codeowners-validatorinfoinstalled/usr/local/bin/codeowners-validator▲#CloneexamplerepositorywithsampleCODEOWNERS▲#CloneexamplerepositorywithsampleCODEOWNERS▲gitclonegit@github.com:gh-codeowners/codeowners-samples.gitCloninginto'codeowners-samples'...remote:Enumeratingobjects:8,done.remote:Countingobjects:100%(8/8),done.remote:Compressingobjects:100%(3/3),done.remote:Total8(delta0),reused8(delta0),pack-reused0Receivingobjects:100%(8/8),done.▲#Executecodeowners-validatoragainstclonedrepository▲#Executecodeowners-validatoragainstclonedrepositoryEXPERIMENTAL_CHECKS="notowned"\GITHUB_ACCESS_TOKEN="${GH_TOKEN}"\▲#Downloadcodeowners-validatorbinarycodeowners-validator▲envREPOSITORY_PATH="./codeowners-samples"\EXPERIMENTAL_CHECKS="notowned"\GITHUB_ACCESS_TOKEN="${GH_TOKEN}"\OWNER_CHECKER_ORGANIZATION_NAME="gh-codeowners"\codeowners-validator==>ExecutingFileExistChecker(1.240501ms)[err]line13:"/scripts/"doesnotmatchanyfilesinrepository==>ExecutingDuplicatedPatternChecker(1.820841ms)[err]Pattern"/some/awesome/dir"isdefined2timesinlines:*10:withowners:[@stitchfix@owner-a]*11:withowners:[@octocat]==>Executing[Experimental]NotOwnedFileChecker(38.920431ms)CheckOK==>ExecutingValidOwnerChecker(1.238375347s)[err]line8:User"@stitchfix"isnotamemberoftheorganization[err]line10:User"@owner-a"doesnothavegithubaccount[err]line11:User"@octocat"isnotamemberoftheorganization4check(s)executed,3failure(s)▲▲#Downloadcodeowners-validatorbinary▲#Downloadcodeowners-validatorbinary▲#Downloadcodeowners-validatorbinary▲curl-sfLhttps://raw.githubusercontent.com/stitchfix/codeowners-validator/main/install.sh|sh-s---b/usr/local▲curl-sfLhttps://raw.githubusercontent.com/stitchfix/codeowners-validator/main/install.sh|sh-s---b/usr/local▲curl-sfLhttps://raw.githubusercontent.com/stitchfix/codeowners-validator/main/install.sh|sh-s---b/usr/local▲curl-sfLhttps://raw.githubusercontent.com/stitchfix/codeowners-validator/main/install.sh|sh-s---b/usr/local▲curl-sfLhttps://raw.githubusercontent.com/stitchfix/codeowners-validator/main/install.sh|sh-s---b/usr/local▲curl-sfLhttps://raw.githubusercontent.com/stitchfix/codeowners-validator/main/install.sh|sh-s---b/usr/local▲curl-sfLhttps://raw.githubusercontent.com/stitchfix/codeowners-validator/main/install.sh|sh-s---b/usr/local▲curl-sfLhttps://raw.githubusercontent.com/stitchfix/codeowners-validator/main/install.sh|sh-s---b/usr/local▲curl-sfLhttps://raw.githubusercontent.com/stitchfix/codeowners-validator/main/install.sh|sh-s---b/usr/local▲curl-sfLhttps://raw.githubusercontent.com/stitchfix/codeowners-validator/main/install.sh|sh-s---b/usr/local▲curl-sfLhttps://raw.githubusercontent.com/stitchfix/codeowners-validator/main/install.sh|sh-s---b/usr/local▲curl-sfLhttps://raw.githubusercontent.com/stitchfix/codeowners-validator/main/install.sh|sh-s---b/usr/local▲curl-sfLhttps://raw.githubusercontent.com/stitchfix/codeowners-validator/main/install.sh|sh-s---b/usr/local▲curl-sfLhttps://raw.githubusercontent.com/stitchfix/codeowners-validator/main/install.sh|sh-s---b/usr/local▲curl-sfLhttps://raw.githubusercontent.com/stitchfix/codeowners-validator/main/install.sh|sh-s---b/usr/local▲curl-sfLhttps://raw.githubusercontent.com/stitchfix/codeowners-validator/main/install.sh|sh-s---b/usr/local▲curl-sfLhttps://raw.githubusercontent.com/stitchfix/codeowners-validator/main/install.sh|sh-s---b/usr/local/binv0.2.0/binv0.2.0/binv0.2.0/binv0.2.0▲#CloneexamplerepositorywithsampleCODEOWNERS▲#CloneexamplerepositorywithsampleCODEOWNERS▲#CloneexamplerepositorywithsampleCODEOWNERS▲#CloneexamplerepositorywithsampleCODEOWNERS▲#CloneexamplerepositorywithsampleCODEOWNERS▲gitclonegit@github.com:gh-codeowners/codeowners-samples.git▲gitclonegit@github.com:gh-codeowners/codeowners-samples.git▲gitclonegit@github.com:gh-codeowners/codeowners-samples.git▲gitclonegit@github.com:gh-codeowners/codeowners-samples.git▲gitclonegit@github.com:gh-codeowners/codeowners-samples.git▲gitclonegit@github.com:gh-codeowners/codeowners-samples.git▲gitclonegit@github.com:gh-codeowners/codeowners-samples.git▲gitclonegit@github.com:gh-codeowners/codeowners-samples.git▲gitclonegit@github.com:gh-codeowners/codeowners-samples.git▲gitclonegit@github.com:gh-codeowners/codeowners-samples.gitReceivingobjects:12%(1/8)Receivingobjects:100%(8/8)▲#Executecodeowners-validatoragainstclonedrepository▲#Executecodeowners-validatoragainstclonedrepository▲#Executecodeowners-validatoragainstclonedrepository▲#Executecodeowners-validatoragainstclonedrepository▲#Executecodeowners-validatoragainstclonedrepository▲envREPOSITORY_PATH="./codeowners-samples"\▲envREPOSITORY_PATH="./codeowners-samples"\▲envREPOSITORY_PATH="./codeowners-samples"\▲envREPOSITORY_PATH="./codeowners-samples"\▲envREPOSITORY_PATH="./codeowners-samples"\EXPERIMENTAL_CHECKS="notowned"\EXPERIMENTAL_CHECKS="notowned"\GITHUB_ACCESS_TOKEN="${GH_TOKEN}"\GITHUB_ACCESS_TOKEN="${GH_TOKEN}"\GITHUB_ACCESS_TOKEN="${GH_TOKEN}"\GITHUB_ACCESS_TOKEN="${GH_TOKEN}"\OWNER_CHECKER_ORGANIZATION_NAME="gh-codeowners"\OWNER_CHECKER_ORGANIZATION_NAME="gh-codeowners"\OWNER_CHECKER_ORGANIZATION_NAME="gh-codeowners"\OWNER_CHECKER_ORGANIZATION_NAME="gh-codeowners"\OWNER_CHECKER_ORGANIZATION_NAME="gh-codeowners"\codeowners-validator[err]
diff --git a/docs/gh-action.md b/docs/gh-action.md
index a4572c5..932b60e 100644
--- a/docs/gh-action.md
+++ b/docs/gh-action.md
@@ -9,10 +9,10 @@
##
-The [Codeowners Validator](https://github.com/mszostok/codeowners-validator) is available as a GitHub Action.
+The [Codeowners Validator](https://github.com/stitchfix/codeowners-validator) is available as a GitHub Action.
-
+
@@ -35,7 +35,7 @@ jobs:
# Checks-out your repository, which is validated in the next step
- uses: actions/checkout@v2
- name: GitHub CODEOWNERS Validator
- uses: mszostok/codeowners-validator@v0.6.0
+ uses: stitchfix/codeowners-validator@v0.6.5
# input parameters
with:
# "The list of checks that will be executed. By default, all checks are executed. Possible values: files,owners,duppatterns,syntax"
diff --git a/docs/investigation/file_exists_checker/glob.md b/docs/investigation/file_exists_checker/glob.md
index 3fd3ed7..644dfca 100644
--- a/docs/investigation/file_exists_checker/glob.md
+++ b/docs/investigation/file_exists_checker/glob.md
@@ -7,7 +7,7 @@ This document describes investigation about [`file exists`](../../../internal/ch
A [CODEOWNERS](https://docs.github.com/en/free-pro-team@latest/github/creating-cloning-and-archiving-repositories/about-code-owners#codeowners-syntax) file uses a pattern that follows the same rules used in [gitignore](https://git-scm.com/docs/gitignore#_pattern_format) files.
The gitignore files support two consecutive asterisks ("**") in patterns that match against the full path name. Unfortunately the core Go library `filepath.Glob` does not support [`**`](https://github.com/golang/go/issues/11862) at all.
-This caused that for some patterns the [`file exists`](../../../internal/check/file_exists.go) checker didn't work properly, see [issue#22](https://github.com/mszostok/codeowners-validator/issues/22).
+This caused that for some patterns the [`file exists`](../../../internal/check/file_exists.go) checker didn't work properly, see [issue#22](https://github.com/stitchfix/codeowners-validator/issues/22).
Additionally, we need to support a single asterisk at the beginning of the pattern. For example, `*.js` should check for all JS files in the whole git repository. To achieve that we need to detect that and change from `*.js` to `**/*.js`.
diff --git a/docs/investigation/file_exists_checker/go.mod b/docs/investigation/file_exists_checker/go.mod
index e95d277..4aebfb8 100644
--- a/docs/investigation/file_exists_checker/go.mod
+++ b/docs/investigation/file_exists_checker/go.mod
@@ -1,4 +1,4 @@
-module github.com/mszostok/codeowners-validator/docs/investigation/file_exists_checker
+module github.com/stitchfix/codeowners-validator/docs/investigation/file_exists_checker
go 1.15
diff --git a/go.mod b/go.mod
index 27d3afc..f962056 100644
--- a/go.mod
+++ b/go.mod
@@ -1,4 +1,4 @@
-module github.com/mszostok/codeowners-validator
+module github.com/stitchfix/codeowners-validator
go 1.17
diff --git a/install.sh b/install.sh
index 1182a54..db9b9da 100755
--- a/install.sh
+++ b/install.sh
@@ -6,13 +6,13 @@ set -e
usage() {
this=$1
cat < Executing Duplicated Pattern Checker ()
[err] Pattern "/some/awesome/dir" is defined 2 times in lines:
- * 10: with owners: [@mszostok @owner-a]
+ * 10: with owners: [@stitchfix @owner-a]
* 11: with owners: [@octocat]
1 check(s) executed, 1 failure(s)