Skip to content

How to trigger a single build on either push or pull_request #26872

Answered by ethomson
gitfool asked this question in Actions
Discussion options

You must be logged in to vote

You can specify the branches that you want builds to run on.  WIth the on: [push, pull_request] setting, you’ll get any pushes into _any_ branch, and pull requests into _any_ branch.

This means that when dependabot creates its branch - in this case,

dependabot/nuget/Microsoft.NET.Test.Sdk-16.3.0 - that your build will run.  It will then run again when it creates the pull request from that branch.

If you only want to run when something has a pull request opened into master, or when something is merged into master, then you can specify this as:

on:
  push:
    branches:
    - master
  pull_request:
    branches:
    - master

Replies: 4 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
4 participants