Skip to content

Commit 8eb16b0

Browse files
CopilotNewFuture
andauthored
fix(workflows): pass GITHUB_REF_NAME to workflows for correct version in extraction path (#579)
* Initial plan * fix(docker): add GITHUB_REF_NAME to Dockerfile for correct version extraction path Co-authored-by: NewFuture <6290356+NewFuture@users.noreply.github.com> * fix(workflows): add GITHUB_REF_NAME env to patch.py docker steps The patch.py docker command runs on the GitHub Actions runner before the Docker build, but it didn't have access to GITHUB_REF_NAME environment variable. This caused it to fall back to the hardcoded version 4.0.0.devXXXXX. Added GITHUB_REF_NAME environment variable to the workflow steps that run patch.py docker in both publish.yml and build.yml. This complements the Dockerfile fix by ensuring version is correct at both stages: 1. Pre-patch on runner (now fixed) 2. Patch inside Docker build (already fixed in previous commit) Co-authored-by: NewFuture <6290356+NewFuture@users.noreply.github.com> * revert: remove GITHUB_REF_NAME from Dockerfile and revert http.py changes As requested, reverted the Dockerfile changes (ARG/ENV GITHUB_REF_NAME) and the http.py changes (Python 2/3 compatibility removal that was an unintended side effect). The fix now only modifies the workflow files (publish.yml and build.yml) to set GITHUB_REF_NAME environment variable for the patch.py docker steps that run on the GitHub Actions runner. Co-authored-by: NewFuture <6290356+NewFuture@users.noreply.github.com> * revert: restore http.py try/except for Python 2/3 compatibility The previous commit only reverted the Dockerfile. This commit properly restores the http.py file to its original state with Python 2/3 compatibility (try/except blocks). Co-authored-by: NewFuture <6290356+NewFuture@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: NewFuture <6290356+NewFuture@users.noreply.github.com>
1 parent ae5e9d0 commit 8eb16b0

2 files changed

Lines changed: 4 additions & 0 deletions

File tree

.github/workflows/build.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -349,6 +349,8 @@ jobs:
349349
steps:
350350
- uses: actions/checkout@v4
351351
- run: python3 .github/patch.py docker
352+
env:
353+
GITHUB_REF_NAME: ${{ github.ref_name }}
352354
- uses: docker/setup-qemu-action@v3 # 仅仅在需要时启用 QEMU 支持
353355
if: matrix.host == 'qemu'
354356
with:

.github/workflows/publish.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ jobs:
2424
steps:
2525
- uses: actions/checkout@v4
2626
- run: python3 .github/patch.py docker
27+
env:
28+
GITHUB_REF_NAME: ${{ github.ref_name }}
2729
- uses: docker/setup-qemu-action@v3
2830
with:
2931
platforms: ${{ env.platforms }}

0 commit comments

Comments
 (0)