All checks were successful
Template Cleanup / Template Cleanup (push) Successful in 3s
54 lines
1.5 KiB
YAML
54 lines
1.5 KiB
YAML
name: Template Cleanup
|
|
on:
|
|
push:
|
|
branches: [ main ]
|
|
|
|
jobs:
|
|
|
|
# 当前仓库名不为 zabbix-agent-2-plugin-template 时触发
|
|
template-cleanup:
|
|
name: Template Cleanup
|
|
runs-on: ubuntu-latest
|
|
#if: github.event.repository.name != 'zabbix-agent-2-plugin-template'
|
|
permissions:
|
|
contents: write
|
|
steps:
|
|
|
|
# 检出当前仓库
|
|
- name: Fetch Sources
|
|
uses: actions/checkout@v4
|
|
|
|
# 项目清理
|
|
- name: Cleanup
|
|
run: |
|
|
export LC_CTYPE=C
|
|
export LANG=C
|
|
|
|
# 变量
|
|
OWNER=$(echo $GITHUB_REPOSITORY_OWNER | tr '[:upper:]' '[:lower:]')
|
|
REPO_NAME="${GITHUB_REPOSITORY##*/}"
|
|
SAFE_OWNER=$(echo $OWNER | sed 's/[^a-zA-Z0-9]//g' | tr '[:upper:]' '[:lower:]')
|
|
SAFE_REPO_NAME=$(echo $REPO_NAME | sed 's/[^a-zA-Z0-9]//g' | tr '[:upper:]' '[:lower:]')
|
|
GROUP="cn.sh.ittc.$SAFE_OWNER.$SAFE_REPO_NAME"
|
|
|
|
echo $REPO_NAME
|
|
echo $OWNER
|
|
echo $SAFE_REPO_NAME
|
|
echo $SAFE_OWNER
|
|
echo $GROUP
|
|
|
|
# # 记录文件修改
|
|
# - name: Commit files
|
|
# run: |
|
|
# git config --local user.email "action@github.com"
|
|
# git config --local user.name "GitHub Action"
|
|
# git add .
|
|
# git commit -m "Template cleanup"
|
|
#
|
|
# # 推送更改
|
|
# - name: Push changes
|
|
# uses: ad-m/github-push-action@master
|
|
# with:
|
|
# branch: main
|
|
# github_token: ${{ secrets.GITHUB_TOKEN }}
|