Skip to content

Commit 8b98b36

Browse files
Copilotnjzjz
andauthored
fix: add tags trigger to release workflow to enable tag-based releases (#544)
The release workflow was broken after #537 added `branches-ignore` to prevent running on bot branches. While this successfully prevented unnecessary runs on `copilot/**`, `dependabot/**`, and `pre-commit-ci-update-config` branches, it inadvertently prevented the workflow from running on tag pushes. The issue occurs because GitHub Actions treats tag pushes differently from branch pushes. When using `branches-ignore` without an explicit `tags` section, the workflow will only trigger on branch pushes (excluding the ignored ones) and pull requests, but not on tag pushes. The `release.yml` workflow has a condition `if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')` indicating it's designed to run on tag pushes, but without the proper trigger configuration, it never gets the chance to execute. This fix adds an explicit `tags` trigger to the workflow: ```yaml on: push: branches-ignore: - 'copilot/**' - 'dependabot/**' - 'pre-commit-ci-update-config' tags: - 'v*' pull_request: ``` This follows the same pattern used in: - The deepmd-kit repository (PR #3402) which had the identical issue - Other workflows in this repository (`ci-docker.yml` and `publish_conda.yml`) that already correctly trigger on tags The workflow will now run on: - Branch pushes (excluding bot branches) - Tag pushes matching the `v*` pattern (e.g., `v1.0.0`, `v2.1.3`) - Pull requests The PyPI publishing step will only execute when the workflow is triggered by a tag push, as intended by the existing condition. Fixes #543. > [!WARNING] > > <details> > <summary>Firewall rules blocked me from connecting to one or more addresses (expand for details)</summary> > > #### I tried to connect to the following addresses, but was blocked by firewall rules: > > - `39.106.xx.xx` > - Triggering command: `python -m coverage run -p --source=./dpdispatcher -m unittest -v` (dns block) > > If you need me to access, download, or install something from one of these locations, you can either: > > - Configure [Actions setup steps](https://gh.io/copilot/actions-setup-steps) to set up my environment, which run before the firewall is enabled > - Add the appropriate URLs or hosts to the custom allowlist in this repository's [Copilot coding agent settings](https://github.com/deepmodeling/dpdispatcher/settings/copilot/coding_agent) (admins only) > > </details> <!-- START COPILOT CODING AGENT TIPS --> --- 💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more [Copilot coding agent tips](https://gh.io/copilot-coding-agent-tips) in the docs. --------- Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: njzjz <[email protected]>
1 parent 2fc5d55 commit 8b98b36

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

.github/workflows/release.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
- 'copilot/**'
55
- 'dependabot/**'
66
- 'pre-commit-ci-update-config'
7+
tags:
8+
- 'v*'
79
pull_request:
810
name: Release to pypi
911
jobs:

0 commit comments

Comments
 (0)