Skip to content

Commit

Permalink
Merge pull request #1687 from jaimergp/ci-triggers-push
Browse files Browse the repository at this point in the history
only enable push events to chosen branch(es) when `upload_on_branch` is enabled
  • Loading branch information
isuruf authored Nov 7, 2023
2 parents 8a9a84a + 5beab45 commit 992fb6d
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 1 deletion.
11 changes: 10 additions & 1 deletion conda_smithy/templates/github-actions.yml.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,16 @@
{%- endfor %}

name: Build conda package
on: {{ github_actions.triggers }}
on:
{%- for trigger in github_actions.triggers %}
{%- if trigger == "push" and upload_on_branch %}
push:
branches:
- {{ upload_on_branch }}
{%- else %}
{{ trigger }}:
{%- endif %}
{% endfor %}

{%- if github_actions.cancel_in_progress %}
concurrency:
Expand Down
23 changes: 23 additions & 0 deletions news/upload_gha.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
**Added:**

* <news item>

**Changed:**

* When upload_on_branch is set, GHA is triggered only for that branch (#1687).

**Deprecated:**

* <news item>

**Removed:**

* <news item>

**Fixed:**

* <news item>

**Security:**

* <news item>

0 comments on commit 992fb6d

Please sign in to comment.