mirror of
https://git.bjxgj.com/xgj/xgj-actions.git
synced 2025-10-14 17:13:38 +08:00
fix: 更新 cache-state 示例文件,修正 GitHub Action 使用路径,从 .actions/xgj/cache-state@v1 修改为 actions/xgj/cache-state@v1,以确保正确引用和执行缓存状态管理功能。
This commit is contained in:
@@ -41,7 +41,7 @@ jobs:
|
||||
|
||||
- name: 获取或设置功能开关状态
|
||||
id: feature-flag
|
||||
uses: .actions/xgj/cache-state@v1
|
||||
uses: actions/xgj/cache-state@v1
|
||||
with:
|
||||
state-key: 'feature-${{ github.event.inputs.feature_name }}-${{ github.event.inputs.environment }}'
|
||||
state-value: ${{ github.event.inputs.feature_enabled }}
|
||||
@@ -51,7 +51,7 @@ jobs:
|
||||
|
||||
- name: 管理灰度发布配置
|
||||
id: rollout
|
||||
uses: .actions/xgj/cache-state@v1
|
||||
uses: actions/xgj/cache-state@v1
|
||||
with:
|
||||
state-key: 'rollout-${{ github.event.inputs.feature_name }}-${{ github.event.inputs.environment }}'
|
||||
state-value: ${{ github.event.inputs.rollout_percentage }}
|
||||
@@ -60,7 +60,7 @@ jobs:
|
||||
action: 'get-or-set'
|
||||
|
||||
- name: 记录功能开关变更历史
|
||||
uses: .actions/xgj/cache-state@v1
|
||||
uses: actions/xgj/cache-state@v1
|
||||
with:
|
||||
state-key: 'feature-history-${{ github.event.inputs.feature_name }}'
|
||||
state-value: '${{ github.event.inputs.environment }}:${{ github.event.inputs.feature_enabled }}:${{ github.run_started_at }}'
|
||||
@@ -100,7 +100,7 @@ jobs:
|
||||
|
||||
- name: 获取服务特定的功能配置
|
||||
id: service-config
|
||||
uses: .actions/xgj/cache-state@v1
|
||||
uses: actions/xgj/cache-state@v1
|
||||
with:
|
||||
state-key: 'service-config-${{ matrix.service }}-${{ github.event.inputs.environment }}'
|
||||
default-value: '{"features":{},"version":"1.0"}'
|
||||
@@ -133,7 +133,7 @@ jobs:
|
||||
esac
|
||||
|
||||
- name: 更新服务配置状态
|
||||
uses: .actions/xgj/cache-state@v1
|
||||
uses: actions/xgj/cache-state@v1
|
||||
with:
|
||||
state-key: 'service-config-applied-${{ matrix.service }}'
|
||||
state-value: '${{ github.event.inputs.feature_name }}:${{ needs.manage-feature-flags.outputs.feature-state }}'
|
||||
@@ -149,7 +149,7 @@ jobs:
|
||||
|
||||
- name: 初始化功能监控指标
|
||||
id: init-metrics
|
||||
uses: .actions/xgj/cache-state@v1
|
||||
uses: actions/xgj/cache-state@v1
|
||||
with:
|
||||
state-key: 'metrics-${{ github.event.inputs.feature_name }}-${{ github.event.inputs.environment }}'
|
||||
default-value: '{"users":0,"errors":0,"performance":100}'
|
||||
@@ -175,7 +175,7 @@ jobs:
|
||||
echo "performance_score=${PERFORMANCE_SCORE}" >> $GITHUB_ENV
|
||||
|
||||
- name: 更新功能监控指标
|
||||
uses: .actions/xgj/cache-state@v1
|
||||
uses: actions/xgj/cache-state@v1
|
||||
with:
|
||||
state-key: 'metrics-${{ github.event.inputs.feature_name }}-${{ github.event.inputs.environment }}'
|
||||
state-value: '{"users":${{ env.users_count }},"errors":${{ env.error_count }},"performance":${{ env.performance_score }}}'
|
||||
@@ -202,7 +202,7 @@ jobs:
|
||||
|
||||
- name: 记录异常告警
|
||||
if: env.alert != 'none'
|
||||
uses: .actions/xgj/cache-state@v1
|
||||
uses: actions/xgj/cache-state@v1
|
||||
with:
|
||||
state-key: 'alert-${{ github.event.inputs.feature_name }}-${{ github.event.inputs.environment }}'
|
||||
state-value: '${{ env.alert }}:${{ github.run_started_at }}'
|
||||
@@ -219,7 +219,7 @@ jobs:
|
||||
|
||||
- name: 检查是否需要回滚
|
||||
id: check-rollback
|
||||
uses: .actions/xgj/cache-state@v1
|
||||
uses: actions/xgj/cache-state@v1
|
||||
with:
|
||||
state-key: 'alert-${{ github.event.inputs.feature_name }}-${{ github.event.inputs.environment }}'
|
||||
default-value: 'none'
|
||||
@@ -235,7 +235,7 @@ jobs:
|
||||
|
||||
- name: 禁用功能开关
|
||||
if: contains(steps.check-rollback.outputs.state-value, 'high_error_rate')
|
||||
uses: .actions/xgj/cache-state@v1
|
||||
uses: actions/xgj/cache-state@v1
|
||||
with:
|
||||
state-key: 'feature-${{ github.event.inputs.feature_name }}-${{ github.event.inputs.environment }}'
|
||||
state-value: 'false'
|
||||
@@ -244,7 +244,7 @@ jobs:
|
||||
|
||||
- name: 记录回滚操作
|
||||
if: contains(steps.check-rollback.outputs.state-value, 'high_error_rate')
|
||||
uses: .actions/xgj/cache-state@v1
|
||||
uses: actions/xgj/cache-state@v1
|
||||
with:
|
||||
state-key: 'rollback-${{ github.event.inputs.feature_name }}-${{ github.event.inputs.environment }}'
|
||||
state-value: 'auto-rollback:${{ github.run_started_at }}'
|
||||
@@ -270,7 +270,7 @@ jobs:
|
||||
|
||||
- name: 获取最终功能状态
|
||||
id: final-state
|
||||
uses: .actions/xgj/cache-state@v1
|
||||
uses: actions/xgj/cache-state@v1
|
||||
with:
|
||||
state-key: 'feature-${{ github.event.inputs.feature_name }}-${{ github.event.inputs.environment }}'
|
||||
action: 'get'
|
||||
@@ -278,7 +278,7 @@ jobs:
|
||||
|
||||
- name: 获取监控指标
|
||||
id: final-metrics
|
||||
uses: .actions/xgj/cache-state@v1
|
||||
uses: actions/xgj/cache-state@v1
|
||||
with:
|
||||
state-key: 'metrics-${{ github.event.inputs.feature_name }}-${{ github.event.inputs.environment }}'
|
||||
action: 'get'
|
||||
@@ -286,7 +286,7 @@ jobs:
|
||||
|
||||
- name: 检查回滚历史
|
||||
id: rollback-check
|
||||
uses: .actions/xgj/cache-state@v1
|
||||
uses: actions/xgj/cache-state@v1
|
||||
with:
|
||||
state-key: 'rollback-${{ github.event.inputs.feature_name }}-${{ github.event.inputs.environment }}'
|
||||
default-value: 'none'
|
||||
@@ -318,7 +318,7 @@ jobs:
|
||||
# 例如,清理超过一定时间的开发环境功能开关
|
||||
|
||||
- name: 重置开发环境告警
|
||||
uses: .actions/xgj/cache-state@v1
|
||||
uses: actions/xgj/cache-state@v1
|
||||
with:
|
||||
state-key: 'dev-alerts-cleared'
|
||||
state-value: '${{ github.run_started_at }}'
|
||||
|
Reference in New Issue
Block a user