Files
Yun Pan f95851de89 fix(workflows): Add repository owner check for some workflows (#6179)
* fix(sync_code): add conditional check for repository owner in workflow

Signed-off-by: Yun Pan <dinoallo@netc.it>

* fix(workflows): add repository owner check for E2E tests in k3s and k8s workflows

Signed-off-by: Yun Pan <dinoallo@netc.it>

---------

Signed-off-by: Yun Pan <dinoallo@netc.it>
2025-11-13 12:33:34 +08:00

34 lines
1.0 KiB
YAML

name: Sync Code
on:
push:
branches:
- main
paths:
- lifecycle/staging/src/github.com/labring/**
- LICENSE.md
- .github/workflows/sync_code.yml
- .github/sync_code.yml
workflow_dispatch:
jobs:
sync:
# Only run this workflow when the repository owner is `labring`.
# This prevents the sync action from running in forks or mirrors owned by others.
if: github.repository_owner == 'labring'
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Run GitHub File Sync
# Can update to v1 when https://github.com/BetaHuhn/repo-file-sync-action/issues/168 is resolved
uses: BetaHuhn/repo-file-sync-action@v1
with:
GH_PAT: ${{ secrets.SYNC_CODE_PAT }}
CONFIG_PATH: .github/sync_code.yml
ORIGINAL_MESSAGE: true
SKIP_PR: true
COMMIT_EACH_FILE: false
COMMIT_BODY: "Change-type: patch"
GIT_EMAIL: "sealos-ci-robot@sealos.io"
GIT_USERNAME: "sealos-ci-robot"