ci: add template cleanup CI file
All checks were successful
Template Cleanup / Template Cleanup (push) Has been skipped
All checks were successful
Template Cleanup / Template Cleanup (push) Has been skipped
This commit is contained in:
parent
6539495e4d
commit
c2683ab03f
50
.gitea/workflows/template-cleanup.yaml
Normal file
50
.gitea/workflows/template-cleanup.yaml
Normal file
@ -0,0 +1,50 @@
|
||||
name: Template Cleanup
|
||||
on:
|
||||
push:
|
||||
branches: [ main ]
|
||||
|
||||
jobs:
|
||||
|
||||
# 当前仓库名不为 zabbix-agent-2-plugin-template 时触发
|
||||
template-cleanup:
|
||||
name: Template Cleanup
|
||||
runs-on: ubuntu-latest
|
||||
if: gitea.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
|
||||
|
||||
# 变量
|
||||
NAME="${GITHUB_REPOSITORY##*/}"
|
||||
ACTOR=$(echo $GITHUB_ACTOR | tr '[:upper:]' '[:lower:]')
|
||||
SAFE_NAME=$(echo $NAME | sed 's/[^a-zA-Z0-9]//g' | tr '[:upper:]' '[:lower:]')
|
||||
SAFE_ACTOR=$(echo $ACTOR | sed 's/[^a-zA-Z0-9]//g' | tr '[:upper:]' '[:lower:]')
|
||||
echo $NAME
|
||||
echo $ACTOR
|
||||
echo $SAFE_NAME
|
||||
echo $SAFE_ACTOR
|
||||
|
||||
# # 记录文件修改
|
||||
# - 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 }}
|
Loading…
x
Reference in New Issue
Block a user