Skip to content

Workflows: Fix github.ref_name sometimes is empty when building Docker images - #4937

Merged
RPRX merged 1 commit into
XTLS:mainfrom
Meo597:patch-1
Jul 25, 2025
Merged

RPRX merged 1 commit into
XTLS:mainfrom
Meo597:patch-1

Conversation

@Meo597

@Meo597 Meo597 commented Jul 25, 2025

Copy link
Copy Markdown
Collaborator

@RPRX

RPRX commented Jul 25, 2025

Copy link
Copy Markdown
Member

所以合并这个 PR 后直接 release latest 没问题了吗

@Meo597

Meo597 commented Jul 25, 2025

Copy link
Copy Markdown
Collaborator Author

此 PR 之前直接 release latest 也有一定概率没问题
我之前测过几次都是 ok 的

但 github 有 BUG 导致获取不到标签号
招 BUG 体质就会触发

现在按照他们建议修复,我测了下没出问题

@RPRX

RPRX commented Jul 25, 2025

Copy link
Copy Markdown
Member

招 BUG 体质就会触发

?

@RPRX RPRX changed the title Workflows: Fix github.ref_name sometimes is empty Workflows: Fix github.ref_name sometimes is empty when building Docker images Jul 25, 2025
@RPRX
RPRX merged commit 66025f2 into XTLS:main Jul 25, 2025
@Meo597
Meo597 deleted the patch-1 branch July 25, 2025 14:48
@RPRX

RPRX commented Jul 25, 2025

Copy link
Copy Markdown
Member

测试可以了,旧的 v25.7.25 image 也给顶掉了

@Meo597

Meo597 commented Jul 25, 2025 •

Copy link
Copy Markdown
Collaborator Author

这次的执行结果:

SOURCE_TAG="" # 这是手动运行工作流时填入的版本号
if [[ -z "$SOURCE_TAG" ]]; then
SOURCE_TAG="v25.7.25" # 这是 github.ref_name 取到的值
fi
if [[ -z "$SOURCE_TAG" ]]; then
SOURCE_TAG="v25.7.25" # 这是 github.event.release.tag_name 取到的值
fi

相当于并没有回退到此 PR 提交的那三行

github.ref_name 是在 release 事件偶尔为空


总之现在是按照 github 建议修复的,应该没问题

他们说 github.event.release.tag_name 在 release 时没问题
用这个兜底了

下次还出 bug 可以手动运行 docker 的 workflow
这个要是还不靠谱还可以取 git 中的 tag 来解决问题

maoxikun pushed a commit to maoxikun/Xray-core that referenced this pull request Aug 23, 2025
it2konst pushed a commit to it2konst/game-tun that referenced this pull request Mar 1, 2026
drovosek229 pushed a commit to drovosek229/Xray-core that referenced this pull request Mar 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants