Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix unignored draft prs if no pr labels #100

Merged
merged 3 commits into from
May 5, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 8 additions & 0 deletions catalog/policies/git_push.proposed-run.rego
Expand Up @@ -27,9 +27,17 @@ ignore {
# Ignore draft PRs unless they explicitly have a `spacelift-trigger` label
ignore {
input.pull_request.draft
# we can only check if labels contains something if there is more than one label
count(input.pull_request.labels) > 0
nitrocode marked this conversation as resolved.
Show resolved Hide resolved
input.pull_request.labels[_] != "spacelift-trigger"
}

# Ignore draft PRs if they have 0 labels
ignore {
input.pull_request.draft
count(input.pull_request.labels) == 0
}

# Propose a run if component's files are affected and the pull request action is in the `proposed_run_pull_request_actions` array
# https://docs.spacelift.io/concepts/run/proposed
propose {
Expand Down