From 0f0e7d2f5472031964a2841d2b97fc32e662fe88 Mon Sep 17 00:00:00 2001 From: michaeljguarino Date: Thu, 22 Feb 2024 02:10:15 -0500 Subject: [PATCH] Fix issue w/ solo create pr automations (#494) * Fix issue w/ solo create pr automations This currently segfaults on a nil-pointer deref. Fix here. * fix dockerfile --- .github/CODEOWNERS | 2 +- Dockerfile | 2 +- pkg/pr/updates.go | 4 ++++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 8027f675..30ca4423 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -1 +1 @@ -* @michaeljguarino @DavidSpek @zreigz +* @michaeljguarino @zreigz @floreks @maciaszczykm diff --git a/Dockerfile b/Dockerfile index d5848522..063eeba3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,7 +3,7 @@ FROM ubuntu:22.10 as user # Create a nonroot user for final image RUN useradd -u 10001 nonroot -FROM golang:1.20-alpine3.17 AS builder +FROM golang:1.22-alpine3.19 AS builder WORKDIR /workspace diff --git a/pkg/pr/updates.go b/pkg/pr/updates.go index c1963af2..3702d817 100644 --- a/pkg/pr/updates.go +++ b/pkg/pr/updates.go @@ -7,6 +7,10 @@ import ( ) func applyUpdates(updates *UpdateSpec, ctx map[string]interface{}) error { + if updates == nil { + return nil + } + replacement, err := templateReplacement([]byte(updates.ReplaceTemplate), ctx) if err != nil { return err