Skip to content

How to stop github actions workflow to trigger when the pull request is from dependabot-preview? #26079

Answered by weide-zhou
riprasad asked this question in Actions
Discussion options

You must be logged in to vote

Hi @riprasad,

Image pull request is created from compared branch ‘depbot’ to base branch. Typically workflow can be skipped with below methods:

  1. Use on.pull_request.branches/branches-ignore to limit the base branch. code sample as below:
on: 
  pull_request:
    branches-ignore: 
      - master                                 # pull request to master branch, event will NOT be triggered.
  1. Add if expression in worklfow yaml, eg: skip the job if pull request comes from user dephot. The limitation is the workflow will be listed in the actions tab but the job is skipped.
on: [pull_request]
jobs:
  job1:
    if: github.actor!= 'depbot'   # ignore the pull request which comes from user depbot.

Replies: 4 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Answer selected
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
1 reply
@Mumeii
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment