Add conditional execution for workflows based on repository owner#5345
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates multiple GitHub Actions workflows to conditionally run jobs only when the workflow is executing in the upstream PnP repository (i.e., when github.repository_owner == 'pnp'). This prevents forked copies of the repo from running release/signing/publishing automation while preserving behavior in the official org repo.
Changes:
- Added
if: github.repository_owner == 'pnp'job-level conditions across release, signing, and publishing workflows. - Applied the same conditional gating to scheduled/nightly Docker publishing workflows and associated manifest jobs.
- Added the owner check to documentation- and PR-related workflows to avoid unintended execution in forks.
Reviewed changes
Copilot reviewed 15 out of 15 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| .github/workflows/stabledockerimages.yml | Gates Docker stable image publishing jobs to only run under the pnp org. |
| .github/workflows/signedrelease.yml | Gates the build/sign release job to only run under the pnp org. |
| .github/workflows/scorecard.yml | Gates Scorecard analysis job to only run under the pnp org. |
| .github/workflows/pnpframeworkbuild.yml | Gates PnP.Framework build/sign/package job to only run under the pnp org. |
| .github/workflows/pnpcorebuild.yml | Gates PnP.Core build/sign/package job to only run under the pnp org. |
| .github/workflows/nightlyrelease.yml | Gates nightly release job to only run under the pnp org. |
| .github/workflows/nightlydockerimages.yml | Gates nightly Docker build/push and manifest jobs to only run under the pnp org. |
| .github/workflows/majorrelease.yml | Gates major release job to only run under the pnp org. |
| .github/workflows/codeql.yml | Gates CodeQL analysis job to only run under the pnp org. |
| .github/workflows/closestaleissues.yml | Gates stale issue automation job to only run under the pnp org. |
| .github/workflows/cleanupnightlyreleases.yml | Gates nightly release cleanup job to only run under the pnp org. |
| .github/workflows/checkdocumentationbuild.yml | Gates doc build verification job to only run under the pnp org. |
| .github/workflows/buildpr.yml | Gates PR build job to only run under the pnp org. |
| .github/workflows/buildexternalhelp.yml | Gates external help build job to only run under the pnp org. |
| .github/workflows/builddocsite.yml | Gates doc site build/publish job to only run under the pnp org. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Type
Related Issues?
Changes GH action to execute only when in PnP repo