Skip to content

Commit 7de5b1b

Browse files
committed
scripts: Avoid hardcoding the known generated file paths in verify_commits.sh
Signed-off-by: timflannagan <[email protected]>
1 parent e071f54 commit 7de5b1b

File tree

4 files changed

+10
-3
lines changed

4 files changed

+10
-3
lines changed

Makefile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,4 +189,3 @@ clean:
189189
.PHONY: help
190190
help: ## Display this help.
191191
@awk 'BEGIN {FS = ":.*##"; printf "\nUsage:\n make \033[36m<target>\033[0m\n"} /^[a-zA-Z_0-9-]+:.*?##/ { printf " \033[36m%-15s\033[0m %s\n", $$1, $$2 } /^##@/ { printf "\n\033[1m%s\033[0m\n", substr($$0, 5) } ' $(MAKEFILE_LIST)
192-

scripts/common.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#! /bin/bash
2+
3+
export KNOWN_GENERATED_PATHS=(':!vendor' ':!manifests' ':!go.sum' ':!go.mod')
4+
export UPSTREAM_REMOTES=("api" "operator-registry" "operator-lifecycle-manager")

scripts/sync_pop_candidate.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,4 +71,4 @@ function pop() {
7171
fi
7272
}
7373

74-
pop
74+
pop

scripts/verify_commits.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ set -o errexit
44
set -o pipefail
55
set -o nounset
66

7+
ROOT_DIR=$(dirname "${BASH_SOURCE[@]}")/..
8+
# shellcheck disable=SC1091
9+
source "${ROOT_DIR}/scripts/common.sh"
10+
711
function err() {
812
echo "[$(date +'%Y-%m-%dT%H:%M:%S%z')]: $*" >&2
913
}
@@ -18,7 +22,7 @@ function verify_staging_sync() {
1822
local staging_dir="staging/${remote}"
1923

2024
local outside_staging
21-
outside_staging="$(git show --name-only "${downstream_commit}" -- ":!${staging_dir}" ':!vendor' ':!manifests' ':!go.sum' ':!go.mod')"
25+
outside_staging="$(git show --name-only "${downstream_commit}" -- ":!${staging_dir}" "${KNOWN_GENERATED_PATHS[@]}")"
2226
if [[ -n "${outside_staging}" ]]; then
2327
err "downstream staging commit ${downstream_commit} changes files outside of ${staging_dir}, vendor, and manifests directories"
2428
err "${outside_staging}"

0 commit comments

Comments
 (0)