Home > front end >  Cannot trigger GitHub Actions while pull request from a fork repo
Cannot trigger GitHub Actions while pull request from a fork repo

Time:08-13

There is a private repo and have a GitHub Actions. If I make pull request between branches in this repo, GitHub Actions 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
...

Another developer who only has read premission fork this repo, make some commits, then pull request to the Upstream. The GitHub Actions doesn't been triggered. I have confirmed that he pull request to the correct branch.

Is there any setting let other developer who only has read premission trigger the action in Upstream?


Updated:

There is a option in repo settings called "Run workflows from fork pull requests" but I cannot enable it.

CodePudding user response:

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

If the repo is under an organization, we should enabled it in the organization setting. After that, we can enable it in the repo setting.

  • Related