This is an automated email from the ASF dual-hosted git repository. chaokunyang pushed a commit to branch releases-0.12 in repository https://gitbox.apache.org/repos/asf/fory.git
commit 208eade745f02baa8c4645440e70c84a88411bfb Author: Shawn Yang <[email protected]> AuthorDate: Mon Aug 25 15:17:26 2025 +0800 fix(python): fix publich tag for workflow (#2517) <!-- **Thanks for contributing to Fory.** **If this is your first time opening a PR on fory, you can refer to [CONTRIBUTING.md](https://github.com/apache/fory/blob/main/CONTRIBUTING.md).** Contribution Checklist - The **Apache Fory** community has requirements on the naming of pr titles. You can also find instructions in [CONTRIBUTING.md](https://github.com/apache/fory/blob/main/CONTRIBUTING.md). - Fory has a strong focus on performance. If the PR you submit will have an impact on performance, please benchmark it first and provide the benchmark result here. --> ## Why? In a workflow_run event GitHub gives the Publish workflow a brand-new run context. The variables in that context describe this run, not the upstream one. Unless you push the tag again while the Publish workflow is running, the new context will not contain that tag: github.ref → refs/heads/main (or whatever the default branch is) github.ref_name → main github.ref_type → branch <!-- Describe the purpose of this PR. --> ## What does this PR do? Use the payload that GitHub attaches to the workflow_run event: github.event.workflow_run.head_branch # the tag (or branch) that the upstream workflow ran for github.event.workflow_run.head_sha # the commit SHA These are the values that correspond to the tag push. ## Related issues Closes #2515 ## Does this PR introduce any user-facing change? <!-- If any user-facing interface changes, please [open an issue](https://github.com/apache/fory/issues/new/choose) describing the need to do so and update the document if necessary. Delete section if not applicable. --> - [ ] Does this PR introduce any public API change? - [ ] Does this PR introduce any binary protocol compatibility change? ## Benchmark <!-- When the PR has an impact on performance (if you don't know whether the PR will have an impact on performance, you can submit the PR first, and if it will have impact on performance, the code reviewer will explain it), be sure to attach a benchmark data here. Delete section if not applicable. --> --- .github/workflows/release-python.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release-python.yaml b/.github/workflows/release-python.yaml index 02474e68d..82ead349a 100644 --- a/.github/workflows/release-python.yaml +++ b/.github/workflows/release-python.yaml @@ -51,7 +51,7 @@ jobs: - name: Publish to TestPyPI uses: pypa/gh-action-pypi-publish@release/v1 - if: startsWith(github.ref, 'refs/tags/') && contains(github.ref, '-') + if: startsWith(github.event.workflow_run.head_branch, 'refs/tags/') && contains(github.event.workflow_run.head_branch, '-') with: repository-url: https://test.pypi.org/legacy/ skip-existing: true @@ -61,7 +61,7 @@ jobs: - name: Publish to PyPI uses: pypa/gh-action-pypi-publish@release/v1 - if: startsWith(github.ref, 'refs/tags/') && !contains(github.ref, '-') + if: startsWith(github.event.workflow_run.head_branch, 'refs/tags/') && !contains(github.event.workflow_run.head_branch, '-') with: skip-existing: true verify-metadata: false --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
