Skip to content

Commit 9e352fa

Browse files
committed
chore(scripts): add workflow go-version sync support
Signed-off-by: Dorin Geman <[email protected]>
1 parent 0180d38 commit 9e352fa

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

scripts/sync-go-version.sh

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,10 @@ DOCKERFILE_FILES=()
8686
while IFS= read -r -d '' file; do
8787
DOCKERFILE_FILES+=("$file")
8888
done < <(find . -name 'Dockerfile*' -not -path './pkg/go-containerregistry/*' -print0)
89+
WORKFLOW_FILES=()
90+
while IFS= read -r -d '' file; do
91+
WORKFLOW_FILES+=("$file")
92+
done < <(find .github/workflows -name '*.yml' -print0 2>/dev/null || true)
8993

9094
case "${1:-}" in
9195
check)
@@ -108,6 +112,12 @@ case "${1:-}" in
108112
fi
109113
done
110114

115+
for workflow in "${WORKFLOW_FILES[@]}"; do
116+
if grep -q "go-version:" "$workflow" 2>/dev/null; then
117+
check_file "$workflow" "go-version: $GO_VERSION" "go-version:" "go-version: $GO_VERSION"
118+
fi
119+
done
120+
111121
if [[ "$NEEDS_UPDATE" -eq 1 ]]; then
112122
echo ""
113123
echo "Files are out of sync. Run: ./scripts/sync-go-version.sh sync"
@@ -133,6 +143,10 @@ case "${1:-}" in
133143
update_file "$dockerfile" "ARG GO_VERSION=.*" "ARG GO_VERSION=$GO_VERSION_MINOR"
134144
done
135145

146+
for workflow in "${WORKFLOW_FILES[@]}"; do
147+
update_file "$workflow" "go-version: .*" "go-version: $GO_VERSION"
148+
done
149+
136150
echo ""
137151
echo "Done. Review changes with: git diff"
138152
;;

0 commit comments

Comments
 (0)