2 Commits

Author SHA1 Message Date
3ae3f98df5 Merge pull request 'fix: use git rev-parse for short SHA in build-dev' (#8) from fix/ci-short-sha into dev
All checks were successful
CI / test (push) Successful in 12s
CI / build-dev (push) Successful in 20s
Reviewed-on: #8
2026-03-28 13:19:23 -04:00
65d6514603 fix: use git rev-parse for short SHA in build-dev
All checks were successful
CI / test (pull_request) Successful in 12s
CI / build-dev (pull_request) Has been skipped
$GITEA_SHA is unset on Gitea runners — the nav showed "dev-" with an
empty SHA. git rev-parse --short HEAD works regardless of runner env vars.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-28 13:18:47 -04:00
2 changed files with 8 additions and 1 deletions

View File

@@ -40,7 +40,7 @@ jobs:
password: ${{ secrets.TOKEN }} password: ${{ secrets.TOKEN }}
- name: Compute short SHA - name: Compute short SHA
run: echo "SHORT_SHA=${GITEA_SHA::7}" >> $GITEA_ENV run: echo "SHORT_SHA=$(git rev-parse --short HEAD)" >> $GITEA_ENV
- name: Build and push - name: Build and push
uses: docker/build-push-action@v5 uses: docker/build-push-action@v5

View File

@@ -156,4 +156,11 @@ describe('CI workflow regressions', () => {
// BUILD_VERSION was never passed to docker build. // BUILD_VERSION was never passed to docker build.
expect(ciYml).toContain('BUILD_VERSION') expect(ciYml).toContain('BUILD_VERSION')
}) })
it('short SHA is computed with git rev-parse, not $GITEA_SHA (which is empty)', () => {
// Regression: ${GITEA_SHA::7} expands to "" on Gitea runners — nav showed "dev-".
// git rev-parse --short HEAD works regardless of which env vars the runner sets.
expect(ciYml).toContain('git rev-parse --short HEAD')
expect(ciYml).not.toContain('GITEA_SHA')
})
}) })