Github Action Not Triggered on Pull Request

My github action is not triggering on pull requests from my forked repository into the upstream. Looking to see if anyone else has experienced this and has any suggestions. Here is my setup:

I have an orginizational project (upstream) with two branches: “master” and “next”.

I have a personal fork (origin) of the organizational project.

I then do the following:

  • make local change

  • push local change to my origin

  • create pull request in which the change will be pulled into the “next” branch on the upstream

Given my github workflow, I would expect an action to trigger but it does not.

If I merge the PR, I then see an action trigger. Any ideas why its not triggered on the PR?

Here is my github action:

name: Node.js CI

on:
    push:
        branches: [master, next]
    pull_request:
        branches: [master, next]

jobs:
    build:
        runs-on: ubuntu-latest

        strategy:
            matrix:
                node-version: [12.x]

        steps:
            - uses: actions/checkout@v2
            - name: Use Node.js ${{ matrix.node-version }}
              uses: actions/setup-node@v1
              with:
                  node-version: ${{ matrix.node-version }}
            - run: npm ci
            - run: ... other npm scripts related to my project (lint, test, etc)...
              env:
                  GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
                  NPM_TOKEN: ${{ secrets.GITHUB_TOKEN }}
                  CI: true

Hi @bdsanfelippo ,

Is your upstream repo a private one? There is an limitation for forked repo. Workflows do not run on private base repositories when you open a pull request from a forked repository.

https://help.github.com/en/actions/reference/events-that-trigger-workflows#pull-request-events-for-forked-repositories 

There is another ticket which asked for supporting pull_request events from a fork to a private base repository: https://github.community/t5/GitHub-Actions/Will-GitHub-Actions-support-pull-request-events-from-a-fork-to-a/m-p/44488 You could add your comment there. 

The upstream is an internal repo to a private organization. I will look at these links - thanks.