Files
openit/.github/workflows/Reuse.yaml
2022-07-05 22:35:57 +08:00

32 lines
1.2 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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