Make WordPress Core


Ignore:
Timestamp:
12/09/2020 08:05:01 PM (4 years ago)
Author:
desrosj
Message:

Build/Test Tools: Disable GitHub Action workflow runs triggered on push for forks and mirrors.

In the current state, the workflows run regardless of the repository context. This results many needless workflow runs that waste resources.

Workflow runs for private repositories are not free (accounts have a finite allotment of minutes for private repositories). This becomes problematic in private repositories that also mirror the WordPress develop repository, as any workflow runs will draw from a user’s or organization’s allotted action minutes.

Without blanket disabling the workflow manually for all event triggers, or modifying the workflow files in the forked/mirrored repository, there is no way to tune when the workflows run.

This change introduces a conditional statement into all GitHub Action workflows that prevents them from running on forked/mirrored repositories that are not wordpress-develop, except when a pull request is being submitted to that repository.

The exception to this is the Welcome workflow that posts a helpful message to first time contributors to wordpress-develop. This message is specific to this repository, so should only run when a PR is submitted to that repository.

See #50401.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/.github/workflows/coding-standards.yml

    r49369 r49781  
    2828    name: PHP coding standards
    2929    runs-on: ubuntu-latest
     30    if: ${{ github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' }}
     31
    3032    steps:
    3133      - name: Checkout repository
     
    8688    name: JavaScript coding standards
    8789    runs-on: ubuntu-latest
     90    if: ${{ github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' }}
    8891    env:
    8992      PUPPETEER_SKIP_CHROMIUM_DOWNLOAD: ${{ true }}
     93
    9094    steps:
    9195      - name: Checkout repository
Note: See TracChangeset for help on using the changeset viewer.