Skip to content

Commit 2aad258

Browse files
committed
fix: [skip-version] guard on CI bump + git fetch without --depth=1 [skip-version]
1 parent e0958c3 commit 2aad258

2 files changed

Lines changed: 21 additions & 2 deletions

File tree

‎.github/workflows/build-and-publish.yml‎

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,16 +86,35 @@ jobs:
8686
needs: [test-lpb]
8787
if: ${{ github.event_name != 'pull_request' }}
8888
outputs:
89-
version: ${{ steps.bump.outputs.version }}
89+
version: ${{ steps.set-version.outputs.version }}
9090
steps:
9191
- name: Checkout (with write access)
9292
uses: actions/checkout@v6
9393
with:
9494
fetch-depth: 0
9595
persist-credentials: true
9696

97+
- name: Check for [skip-version]
98+
id: skip
99+
run: |
100+
MSG=$(git log -1 --format=%s)
101+
if echo "$MSG" | grep -q '\[skip-version\]'; then
102+
echo "Skipping version bump for: $MSG"
103+
echo "skipped=true" >> "$GITHUB_OUTPUT"
104+
else
105+
echo "Bumping version for: $MSG"
106+
echo "skipped=false" >> "$GITHUB_OUTPUT"
107+
fi
108+
109+
- name: Set version for build jobs
110+
id: set-version
111+
run: |
112+
VERSION=$(cat VERSION 2>/dev/null || echo "0.0.0-lpb")
113+
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
114+
97115
- name: Bump patch version
98116
id: bump
117+
if: steps.skip.outputs.skipped != 'true'
99118
run: |
100119
set -e
101120
VERSION=$(cat VERSION 2>/dev/null || echo "0.0.0-lpb")

‎Dockerfile‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ RUN set -eux; \
125125
export PATH="/home/lpb/.npm-global/bin:${PATH}"; \
126126
mkdir -p /opt/pi-src && cd /opt/pi-src; \
127127
git clone --depth=1 --branch lpb-dev ${PI_FORK} .; \
128-
git fetch --depth=1 origin ${PI_REF}; \
128+
git fetch origin ${PI_REF}; \
129129
git checkout ${PI_REF}; \
130130
git config user.email "build@localpibox.dev"; \
131131
git config user.name "LocalPibox Build"; \

0 commit comments

Comments
 (0)