Skip to content

How to limit Github workflow runs for certain users who raise PRs #26575

Discussion options

You must be logged in to vote

I was able to find a solution to this. In this case, you can have the build run when a PR is closed, and within an if statemnt have the workflow check if the PR was closed due to a merge, and check who opened the PR.
That would look like this when a PR is merged into develop with the person who opened the PR being octobot:

on:
  pull_request:
    branches: [develop]
    types: [closed]

jobs:
test:
if: github.event.pull_request.merged==true && github.event.pull_request.user.login!='octobot'

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
1 participant