Skip to content

Commit 9e1d749

Browse files
committed
fix(workflows): fix workflow syntax errors, revert Alpine, and enable PR builds
- Change default-branch to target-branch for release-please-action@v4 - Remove invalid continue-on-error input from build-push-action@v6 - Revert Alpine from 3.23.0 to 3.22.2 to fix ARM64 qemu emulation issues - Change golang:1.25.5-alpine to golang:1.25.4-alpine (uses Alpine 3.22.2) - Add pull_request trigger to dev-build workflow - Only push images on push events, not PRs - Skip GHCR login on PRs
1 parent 966a750 commit 9e1d749

File tree

3 files changed

+20
-7
lines changed

3 files changed

+20
-7
lines changed

.github/workflows/dev-build.yml

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,13 @@ on:
99
- LICENSE
1010
- '**/*.example.yml'
1111
- '**/*.example.yaml'
12+
pull_request:
13+
paths-ignore:
14+
- CHANGELOG.md
15+
- '**.md'
16+
- LICENSE
17+
- '**/*.example.yml'
18+
- '**/*.example.yaml'
1219

1320
env:
1421
REGISTRY: ghcr.io
@@ -52,7 +59,13 @@ jobs:
5259
exit 0
5360
fi
5461
62+
# For PR events, check changed files against base branch
63+
if [ "${{ github.event_name }}" = "pull_request" ]; then
64+
BASE_SHA="${{ github.event.pull_request.base.sha }}"
65+
HEAD_SHA="${{ github.event.pull_request.head.sha }}"
66+
CHANGED_FILES=$(git diff --name-only "$BASE_SHA" "$HEAD_SHA")
5567
# For push events, check changed files against base branch
68+
else
5669
BASE_SHA="${{ github.event.before }}"
5770
HEAD_SHA="${{ github.event.after }}"
5871
@@ -62,6 +75,7 @@ jobs:
6275
else
6376
# Get list of changed files
6477
CHANGED_FILES=$(git diff --name-only "$BASE_SHA" "$HEAD_SHA")
78+
fi
6579
fi
6680
6781
if [ -z "$CHANGED_FILES" ]; then
@@ -107,6 +121,7 @@ jobs:
107121
uses: docker/setup-buildx-action@v3
108122

109123
- name: Log in to GHCR
124+
if: github.event_name == 'push'
110125
uses: docker/login-action@v3
111126
with:
112127
registry: ${{ env.REGISTRY }}
@@ -154,13 +169,12 @@ jobs:
154169
with:
155170
context: .
156171
platforms: linux/amd64,linux/arm64
157-
push: true
172+
push: ${{ github.event_name == 'push' }}
158173
tags: ${{ steps.docker_meta.outputs.tags }}
159174
labels: ${{ steps.docker_meta.outputs.labels }}
160175
cache-from: type=gha
161176
cache-to: type=gha,mode=min
162-
continue-on-error: false
163177
build-args: |
164178
VERSION=${{ steps.meta.outputs.dev_tag }}
165179
COMMIT=${{ github.sha }}
166-
BUILD_DATE=${{ github.event.head_commit.timestamp }}
180+
BUILD_DATE=${{ github.event.head_commit.timestamp || github.event.pull_request.head.repo.updated_at }}

.github/workflows/release-please.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
release-type: go
3131
path: .
3232
token: ${{ secrets.RELEASE_TOKEN }}
33-
default-branch: main
33+
target-branch: main
3434
fork: false
3535

3636
# Debug info
@@ -77,7 +77,6 @@ jobs:
7777
labels: ${{ steps.meta.outputs.labels }}
7878
cache-from: type=gha,scope=release-${{ steps.release_please.outputs.tag_name }}
7979
cache-to: type=gha,mode=max,scope=release-${{ steps.release_please.outputs.tag_name }}
80-
continue-on-error: false
8180
build-args: |
8281
VERSION=${{ steps.release_please.outputs.tag_name }}
8382
COMMIT=${{ github.sha }}

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Build stage
2-
FROM golang:1.25.5-alpine AS builder
2+
FROM golang:1.25.4-alpine AS builder
33

44
WORKDIR /app
55

@@ -32,7 +32,7 @@ RUN VERSION=${VERSION:-$(git describe --tags --always --dirty 2>/dev/null || ech
3232
-o ghcr-exporter ./cmd
3333

3434
# Final stage
35-
FROM alpine:3.23.0
35+
FROM alpine:3.22.2
3636

3737
RUN apk --no-cache add ca-certificates wget
3838

0 commit comments

Comments
 (0)