Skip to content

Commit

Permalink
Merge branch 'main' into feat/deploy-pages-from-action
Browse files Browse the repository at this point in the history
  • Loading branch information
noamd-legit authored May 15, 2024
2 parents f595c2b + c4118c9 commit d78fbcd
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,12 +102,12 @@ ARCH=darwin_arm64
SCM_TOKEN=<your_token> legitify analyze
```

By default, legitify will check the policies against all your resources (organizations, repositories, members, actions).
By default, legitify will check the policies against all your resources (organizations, repositories, members, actions). Archived repositories are skipped.

You can control which resources will be analyzed with command-line flags namespace and org:

- `--namespace (-n)`: will analyze policies that relate to the specified resources
- `--org`: will limit the analysis to the specified GitHub organizations or GitLab group
- `--org`: will limit the analysis to the specified GitHub organizations or GitLab group, excluding archived repositories
- `--repo`: will limit the analysis to the specified GitHub repositories or GitLab projects
- `--scm`: specify the source code management platform. Possible values are: `github` or `gitlab`. Defaults to `github`. Please note: when running on GitLab, `--scm gitlab` is required.
- `--enterprise`: will specify which enterprises should be analyzed. Please note: in order to analyze an enterprise, an enterprise slug must be provided.
Expand Down Expand Up @@ -197,7 +197,7 @@ Currently, the following namespaces are supported:
1. `organization` - GitHub organization (or GitLab group) level policies (e.g., "Two-Factor Authentication Is Not Enforced for the Organization")
2. `actions` - organization GitHub Actions policies (e.g., "GitHub Actions Runs Are Not Limited To Verified Actions")
3. `member` - contributor level policies (e.g., "Stale Admin Found")
4. `repository` - GitHub repository (or GitLab Project) level policies (e.g., "Code Review By At Least Two Reviewers Is Not Enforced")
4. `repository` - GitHub repository (or GitLab Project) level policies (e.g., "Code Review By At Least Two Reviewers Is Not Enforced"). Note: Archived repositories are ignored unless specified directly via the `--repo` argument.
5. `runner_group` - runner group policies (e.g, "runner can be used by public repositories")

By default, legitify will analyze all namespaces. You can limit only to selected ones with the `--namespace` flag, and then a comma separated list of the selected namespaces.
Expand Down
4 changes: 2 additions & 2 deletions internal/collectors/github/repository_collector.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ type totalCountRepoQuery struct {
Organization struct {
Repositories struct {
TotalCount githubv4.Int
} `graphql:"repositories(first: 1)"`
} `graphql:"repositories(first: 1, isArchived: false)"`
} `graphql:"organization(login: $login)"`
}

Expand Down Expand Up @@ -180,7 +180,7 @@ type repoQuery struct {
Repositories struct {
PageInfo ghcollected.GitHubQLPageInfo
Nodes []ghcollected.GitHubQLRepository
} `graphql:"repositories(first: 50, after: $repositoryCursor)"`
} `graphql:"repositories(first: 50, after: $repositoryCursor, isArchived: false)"`
} `graphql:"organization(login: $login)"`
}

Expand Down

0 comments on commit d78fbcd

Please sign in to comment.