Skip to content

Commit df27c2b

Browse files
committed
Fix collector.yaml: copy to caller repo with git exclude
GoReleaser extra_files must be relative to workdir (the caller repo). Copy collector.yaml into the caller repo and add it to .git/info/exclude so GoReleaser can find it without dirtying the git state.
1 parent c803214 commit df27c2b

2 files changed

Lines changed: 5 additions & 2 deletions

File tree

.github/workflows/release.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -772,7 +772,10 @@ jobs:
772772
mkdir -p "${GENERATED_DIR}"
773773
envsubst '$REPO_NAME' < templates/.Dockerfile-lambda-template.tmpl | tee "${GENERATED_DIR}/Dockerfile.lambda"
774774
envsubst < templates/.goreleaser-docker-lambda-template.yaml.tmpl | tee "${GENERATED_DIR}/.goreleaser.lambda.yaml"
775-
cp collector.yaml "${GENERATED_DIR}/collector.yaml"
775+
# Copy collector config into caller repo for GoReleaser extra_files.
776+
# Exclude from git to avoid dirty working tree detection.
777+
cp collector.yaml ../_caller/collector.yaml
778+
echo "collector.yaml" >> ../_caller/.git/info/exclude
776779
777780
- name: Docker Login
778781
if: inputs.docker == true

templates/.goreleaser-docker-lambda-template.yaml.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ dockers:
2626
image_templates:
2727
- "168442440833.dkr.ecr.us-west-2.amazonaws.com/${REPO_NAME}:{{ .Version }}-arm64"
2828
extra_files:
29-
- ../_workflows/${GENERATED_DIR}/collector.yaml
29+
- collector.yaml
3030
build_flag_templates:
3131
- "--platform=linux/arm64"
3232
- "--label=org.opencontainers.image.created={{.Date}}"

0 commit comments

Comments
 (0)