fix(ci): audit-force-merge — strip scheme in shell, not broken Gitea | replace #59

Merged
devops-engineer merged 1 commits from fix/audit-server-url-replace-lexer into main 2026-06-10 16:27:15 +00:00
Member

Problem

audit-force-merge job has failed on every run (status=2, all of 2026-06-10) with:

Unable to interpolate expression 'format('{0}', github.server_url | replace('https://', ''))':
Failed to parse: got unexpected character ' ' while lexing || operator, expecting '|'

Named mechanism

The step set GITEA_HOST: ${{ github.server_url | replace('https://','') }}. Gitea's workflow expression lexer mis-parses the single | as the beginning of the || operator, so interpolation fails before the audit script runs. The job is a post-merge (pull_request_target: closed, merged == true) forensic audit, so it does not gate PRs — but the force-merge audit trail has been silently non-functional (not flaky: 6/6 recent runs red).

Fix

Pass github.server_url whole into GITEA_SERVER_URL and strip the scheme in the shell step (${VAR#https://}), which the script already expects as a bare host (API="https://${GITEA_HOST}/api/v1"). No replace() expression.

Verification

  • The only changed file is .gitea/workflows/audit-force-merge.yml.
  • audit-force-merge.sh is unchanged and already consumes a bare GITEA_HOST.

🤖 Generated with Claude Code

## Problem `audit-force-merge` job has failed on **every** run (status=2, all of 2026-06-10) with: ``` Unable to interpolate expression 'format('{0}', github.server_url | replace('https://', ''))': Failed to parse: got unexpected character ' ' while lexing || operator, expecting '|' ``` ## Named mechanism The step set `GITEA_HOST: ${{ github.server_url | replace('https://','') }}`. Gitea's workflow expression lexer mis-parses the single `|` as the beginning of the `||` operator, so interpolation fails **before** the audit script runs. The job is a post-merge (`pull_request_target: closed`, `merged == true`) forensic audit, so it does not gate PRs — but the force-merge audit trail has been silently non-functional (not flaky: 6/6 recent runs red). ## Fix Pass `github.server_url` whole into `GITEA_SERVER_URL` and strip the scheme in the shell step (`${VAR#https://}`), which the script already expects as a bare host (`API="https://${GITEA_HOST}/api/v1"`). No `replace()` expression. ## Verification - The only changed file is `.gitea/workflows/audit-force-merge.yml`. - `audit-force-merge.sh` is unchanged and already consumes a bare `GITEA_HOST`. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
devops-engineer added 1 commit 2026-06-10 15:38:49 +00:00
fix(ci): audit-force-merge — strip scheme in shell, not broken Gitea | replace
CI / test (pull_request) Successful in 30s
audit-force-merge / audit (pull_request_target) Successful in 13s
62114dca90
The Detect force-merge step set GITEA_HOST via
`${{ github.server_url | replace('https://','') }}`. Gitea's expression lexer
mis-parses the single `|` as the start of `||`, so the job fails at
expression-interpolation time (every run, status=2) before the audit
script runs. Pass github.server_url whole and strip the scheme in the
shell step instead.

Named mechanism: Gitea expression lexer `| replace` -> `||` parse error.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
core-qa approved these changes 2026-06-10 16:26:59 +00:00
core-qa left a comment
Member

verified: audit-force-merge strips scheme in shell (not broken Gitea | replace), required CI green (CI / test)

verified: audit-force-merge strips scheme in shell (not broken Gitea | replace), required CI green (CI / test)
core-security approved these changes 2026-06-10 16:27:06 +00:00
core-security left a comment
Member

verified: audit-force-merge strips scheme in shell (not broken Gitea | replace), required CI green (CI / test)

verified: audit-force-merge strips scheme in shell (not broken Gitea | replace), required CI green (CI / test)
devops-engineer merged commit 2c1f5257cc into main 2026-06-10 16:27:15 +00:00
Sign in to join this conversation.
3 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: molecule-ai/molecule-mcp-server#59