自动同步 workflow 不覆盖现有 CI
All checks were successful
itom-platform auto build image / build (push) Has been skipped
All checks were successful
itom-platform auto build image / build (push) Has been skipped
This commit is contained in:
@@ -10,12 +10,16 @@ permissions:
|
||||
contents: read
|
||||
packages: write
|
||||
|
||||
env:
|
||||
# CI 触发模式:优先仓库变量,其次 Secrets(默认 dispatch)
|
||||
CI_TRIGGER_MODE: ${{ vars.CI_TRIGGER_MODE || secrets.CI_TRIGGER_MODE || 'dispatch' }}
|
||||
|
||||
jobs:
|
||||
build:
|
||||
# 触发开关:仓库变量 CI_TRIGGER_MODE=dispatch|push|both(默认 dispatch)
|
||||
# 触发开关:CI_TRIGGER_MODE=dispatch|push|both
|
||||
if: |
|
||||
(github.event_name == 'workflow_dispatch' && (vars.CI_TRIGGER_MODE == '' || vars.CI_TRIGGER_MODE == 'dispatch' || vars.CI_TRIGGER_MODE == 'both')) ||
|
||||
(github.event_name == 'push' && (vars.CI_TRIGGER_MODE == 'push' || vars.CI_TRIGGER_MODE == 'both'))
|
||||
(github.event_name == 'workflow_dispatch' && (env.CI_TRIGGER_MODE == 'dispatch' || env.CI_TRIGGER_MODE == 'both')) ||
|
||||
(github.event_name == 'push' && (env.CI_TRIGGER_MODE == 'push' || env.CI_TRIGGER_MODE == 'both'))
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
env:
|
||||
|
||||
Reference in New Issue
Block a user