mirror of
https://github.com/taixingyiji/openit.git
synced 2026-10-20 09:27:41 +00:00
32 lines
1.2 KiB
YAML
32 lines
1.2 KiB
YAML
name: Reuse
|
|
on:
|
|
push:
|
|
paths:
|
|
- 'url'
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
re-job:
|
|
name: Reuse
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
- name: Timezone
|
|
run: sudo timedatectl set-timezone 'Asia/Shanghai'
|
|
- name: git init
|
|
run: |
|
|
git config --local user.name "GitHub Actions"
|
|
git config --local user.email "actions@github.com"
|
|
- name: pool.yaml
|
|
run: | #sed -n '/:\/\//p' bot >> ./openit/url #提取bot文本中符合行中有://字符的行追加到url文本结尾
|
|
sed -i 's/^[ \t]*//g' url #删除行头空格和tab,对齐行头
|
|
sed -i '/^sub:/d' url #删除以sub:开头的行
|
|
sed -i '/^$/d' url #删除空白行
|
|
sed -i -r '/^\s*$/d' url #删除带有空格或制表符的空行
|
|
base64 ./url > ./utils/subconverter/pool -w 0
|
|
./utils/subconverter/subconverter -g --artifact "pool" && rm ./utils/subconverter/pool
|
|
sed -i '1,34d' ./utils/subconverter/pool.yaml #删除pool.yaml开头1-34行
|
|
mv ./utils/subconverter/pool.yaml ./utils/pool/pool.yaml
|
|
- name: git push
|
|
run: git pull origin main && git add . && git commit -m "$(date '+%Y.%m.%d %H:%M:%S') 节点入库" && git push origin main
|