mirror of
https://git.bjxgj.com/xgj/xgj-actions.git
synced 2025-10-14 14:23:37 +08:00
feat: 新增配置构建环境的 GitHub Action,支持 Git 和 kubectl 配置验证
This commit is contained in:
29
config-env/examples/basic-usage.yml
Normal file
29
config-env/examples/basic-usage.yml
Normal file
@@ -0,0 +1,29 @@
|
||||
name: Config Env Example
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
|
||||
jobs:
|
||||
validate-environment:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: 检出代码
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: 校验环境并配置 Git
|
||||
id: config-env
|
||||
uses: actions/xgj/config-env@v1
|
||||
with:
|
||||
git-user-name: "CI Bot"
|
||||
git-user-email: "ci@example.com"
|
||||
require-docker: "true"
|
||||
require-kubectl: "true"
|
||||
verify-kubectl-cluster: "true"
|
||||
kube-config: ${{ secrets.KUBE_CONFIG }}
|
||||
|
||||
- name: 输出工具信息
|
||||
run: |
|
||||
echo "Docker 版本: ${{ steps.config-env.outputs.docker-version }}"
|
||||
echo "kubectl 版本: ${{ steps.config-env.outputs.kubectl-version }}"
|
||||
echo "kubectl 上下文: ${{ steps.config-env.outputs.kubectl-context }}"
|
Reference in New Issue
Block a user