You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There is a Repository that have the following structure regarding the branches:
develop
feature/1
feature/2
....
Inside this repository are 2 workflows: push.yaml and pull_request.yaml
First workflow triggers every time a push occurs since it have this trigger: on: push:
Second workflows triggers every time a Pull Request is opened or changed since it have this trigger: on: pull_request: types: [opened, reopened, edited, review_requested, synchronize]
When I open a Pull Request from a feature branch to develop both workflows triggers. By pushing a commit again triggers both workflows. The thing is that I don't want the push workflow to trigger here. I want it to trigger on every other push except here.
Is there any solution in preventing the push.yaml workflow to run when a commit is pushed for the Pull Request?
The only solution that I could find is this. The problem with this is that it cancels the push workflow and mark it as failure. By doing that I am not able to merge the changes since not all checks are successful.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Let's say that we have the following scenario:
There is a Repository that have the following structure regarding the branches:
Inside this repository are 2 workflows:
push.yaml
andpull_request.yaml
First workflow triggers every time a push occurs since it have this trigger:
on: push:
Second workflows triggers every time a Pull Request is opened or changed since it have this trigger:
on: pull_request: types: [opened, reopened, edited, review_requested, synchronize]
When I open a Pull Request from a feature branch to develop both workflows triggers. By pushing a commit again triggers both workflows. The thing is that I don't want the
push
workflow to trigger here. I want it to trigger on every other push except here.Is there any solution in preventing the
push.yaml
workflow to run when a commit is pushed for the Pull Request?The only solution that I could find is this. The problem with this is that it cancels the push workflow and mark it as failure. By doing that I am not able to merge the changes since not all checks are successful.
Beta Was this translation helpful? Give feedback.
All reactions