mirror of
https://github.com/vmware-tanzu/velero.git
synced 2026-07-19 14:32:36 +00:00
Skip upstream-only workflows on forks
Add repository guard (github.repository == 'velero-io/velero') to workflows that should only run on the upstream repo. This prevents unnecessary CI runs on forks like openshift/velero where these workflows either fail due to missing secrets/config or duplicate fork-specific CI. Guarded workflows: auto_assign_prs, auto_label_prs, auto_request_review, e2e-test-kind, nightly-trivy-scan, pr-changelog-check, pr-codespell, pr-filepath-check, pr-linter-check, prow-action, rebase, stale-issues. Intentionally left unguarded: pr-ci-check (useful for contributors on forks), get-go-version (reusable workflow_call only). Signed-off-by: Shubham Pampattiwar <spampatt@redhat.com>
This commit is contained in:
@@ -14,6 +14,7 @@ permissions:
|
||||
jobs:
|
||||
# Automatically assigns reviewers and owner
|
||||
add-reviews:
|
||||
if: github.repository == 'velero-io/velero'
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Set the author of a PR as the assignee
|
||||
|
||||
@@ -15,6 +15,7 @@ permissions:
|
||||
jobs:
|
||||
# Automatically labels PRs based on file globs in the change.
|
||||
triage:
|
||||
if: github.repository == 'velero-io/velero'
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/labeler@v5
|
||||
|
||||
@@ -11,6 +11,7 @@ permissions:
|
||||
|
||||
jobs:
|
||||
auto-request-review:
|
||||
if: github.repository == 'velero-io/velero'
|
||||
name: Auto Request Review
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
|
||||
@@ -17,6 +17,7 @@ jobs:
|
||||
|
||||
# Build the Velero CLI and image once for all Kubernetes versions, and cache it so the fan-out workers can get it.
|
||||
build:
|
||||
if: github.repository == 'velero-io/velero'
|
||||
runs-on: ubuntu-latest
|
||||
needs: get-go-version
|
||||
outputs:
|
||||
@@ -81,6 +82,7 @@ jobs:
|
||||
# Create json of k8s versions to test
|
||||
# from guide: https://stackoverflow.com/a/65094398/4590470
|
||||
setup-test-matrix:
|
||||
if: github.repository == 'velero-io/velero'
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
GH_TOKEN: ${{ github.token }}
|
||||
@@ -106,6 +108,7 @@ jobs:
|
||||
|
||||
# Run E2E test against all Kubernetes versions on kind
|
||||
run-e2e-test:
|
||||
if: github.repository == 'velero-io/velero'
|
||||
needs:
|
||||
- build
|
||||
- setup-test-matrix
|
||||
|
||||
@@ -5,6 +5,7 @@ on:
|
||||
|
||||
jobs:
|
||||
nightly-scan:
|
||||
if: github.repository == 'velero-io/velero'
|
||||
name: Trivy nightly scan
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
|
||||
@@ -7,6 +7,7 @@ on:
|
||||
jobs:
|
||||
|
||||
build:
|
||||
if: github.repository == 'velero-io/velero'
|
||||
name: Run Changelog Check
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
|
||||
@@ -3,6 +3,7 @@ on: [pull_request]
|
||||
jobs:
|
||||
|
||||
codespell:
|
||||
if: github.repository == 'velero-io/velero'
|
||||
name: Run Codespell
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
|
||||
@@ -3,6 +3,7 @@ on: [pull_request]
|
||||
jobs:
|
||||
|
||||
filepath-check:
|
||||
if: github.repository == 'velero-io/velero'
|
||||
name: Check for invalid characters in file paths
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
|
||||
@@ -13,6 +13,7 @@ jobs:
|
||||
ref: ${{ github.event.pull_request.base.ref }}
|
||||
|
||||
build:
|
||||
if: github.repository == 'velero-io/velero'
|
||||
name: Run Linter Check
|
||||
runs-on: ubuntu-latest
|
||||
needs: get-go-version
|
||||
|
||||
@@ -11,6 +11,7 @@ permissions:
|
||||
|
||||
jobs:
|
||||
execute:
|
||||
if: github.repository == 'velero-io/velero'
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: jpmcb/prow-github-actions@v1.1.3
|
||||
|
||||
@@ -5,7 +5,7 @@ name: Automatic Rebase
|
||||
jobs:
|
||||
rebase:
|
||||
name: Rebase
|
||||
if: github.event.issue.pull_request != '' && contains(github.event.comment.body, '/rebase')
|
||||
if: github.repository == 'velero-io/velero' && github.event.issue.pull_request != '' && contains(github.event.comment.body, '/rebase')
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout the latest code
|
||||
|
||||
@@ -5,6 +5,7 @@ on:
|
||||
|
||||
jobs:
|
||||
stale:
|
||||
if: github.repository == 'velero-io/velero'
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/stale@v10.1.1
|
||||
|
||||
Reference in New Issue
Block a user