Skip to content

fix(python): fix publich tag for workflow#2517

Merged
chaokunyang merged 1 commit into
apache:mainfrom
chaokunyang:fix_publish_tag
Aug 25, 2025
Merged

fix(python): fix publich tag for workflow#2517
chaokunyang merged 1 commit into
apache:mainfrom
chaokunyang:fix_publish_tag

Conversation

@chaokunyang
Copy link
Copy Markdown
Collaborator

@chaokunyang chaokunyang commented Aug 25, 2025

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

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?

  • Does this PR introduce any public API change?
  • Does this PR introduce any binary protocol compatibility change?

Benchmark

@chaokunyang chaokunyang merged commit a9ab4f6 into apache:main Aug 25, 2025
61 checks passed
chaokunyang added a commit to chaokunyang/fory that referenced this pull request Aug 25, 2025
<!--
**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 apache#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.
-->
chaokunyang added a commit that referenced this pull request Aug 27, 2025
<!--
**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.
-->
@chaokunyang chaokunyang review requested due to automatic review settings March 23, 2026 18:43
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.

Publish wheel to pypi is skipped by mistake

2 participants