Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable to trigger GitHub Actions when pull request comes from a forked repository

There is a private repository with a GitHub Actions workflow. When I create a pull request between branches in this repository, the GitHub Actions workflow is triggered correctly.

name: CI

on:
  pull_request:
    branches:
      - pre-production
      - production

jobs:
  build:
    runs-on: self-hosted
    steps:
      - uses: actions/checkout@v3
        with:
          fetch-depth: 2
...

However, when another developer who only has read permission forks this repository, makes some commits, and then creates a pull request to the Upstream, the GitHub Actions workflow is not triggered. I have confirmed that they created the pull request to the correct branch.

Is there a setting that allows other developers with read permission to trigger the GitHub Actions workflow in the Upstream?


Updated:

There is an option in the repository settings called "Run workflows from fork pull requests", but I cannot enable it.

like image 990
Ying-Shan Lin Avatar asked Dec 31 '25 23:12

Ying-Shan Lin


1 Answers

Finally, I found a setting called "Run workflows from fork pull requests". Enable it will solve the problem.

If the repository is under an organization, we should enable it in the organization settings. After that, we can enable it in the repository settings.

like image 120
Ying-Shan Lin Avatar answered Jan 02 '26 18:01

Ying-Shan Lin



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!