mirror of
https://github.com/saveweb/review-2023.git
synced 2024-09-19 10:15:29 -07:00
2023,再见!
This commit is contained in:
parent
e9cac36d1e
commit
50cec8ad11
34
.github/workflows/main.yml
vendored
Executable file
34
.github/workflows/main.yml
vendored
Executable file
@ -0,0 +1,34 @@
|
||||
# This is a basic workflow to help you get started with Actions
|
||||
|
||||
name: CI
|
||||
|
||||
# Controls when the workflow will run
|
||||
on:
|
||||
# Triggers the workflow on push or pull request events but only for the main branch
|
||||
push:
|
||||
branches: [ main ]
|
||||
|
||||
# Allows you to run this workflow manually from the Actions tab
|
||||
workflow_dispatch:
|
||||
|
||||
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2.6.0
|
||||
- name: Setup Python
|
||||
uses: actions/setup-python@v4.3.1
|
||||
- name: Run a one-line script
|
||||
run: python main.py
|
||||
- name: Commit files
|
||||
run: |
|
||||
git config --local user.email "actions@github.com"
|
||||
git config --local user.name "GitHub Action"
|
||||
git add .
|
||||
git commit -m "gen README.md"
|
||||
- name: Push changes
|
||||
uses: ad-m/github-push-action@master
|
||||
with:
|
||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
35
main.py
Normal file
35
main.py
Normal file
@ -0,0 +1,35 @@
|
||||
flag = 0
|
||||
markdown = """# review-2023
|
||||
|
||||
写好了吗?写好了快交。AI 写的不算数哦。
|
||||
|
||||
- 2022 年的年终总结见:[saveweb/review-2022](https://github.com/saveweb/review-2022)
|
||||
|
||||
保持传统,本项目将长期维护(直到2025年初)。
|
||||
|
||||
**想要添加您的年终总结?请发 Issue 或编辑 metadata.md 发PR(不需要填写博客ID)。**
|
||||
|
||||
---
|
||||
|
||||
"""
|
||||
|
||||
with open('metadata.md', 'r') as f:
|
||||
lines = f.read().splitlines()
|
||||
|
||||
header = lines[0:2]
|
||||
|
||||
lines = set(lines[2:])
|
||||
lines.discard('')
|
||||
lines = list(lines)
|
||||
lines.sort()
|
||||
|
||||
# with open('metadata.md', 'w') as f:
|
||||
# for line in header:
|
||||
# f.write(line+'\n')
|
||||
# for line in lines:
|
||||
# f.write(line+'\n')
|
||||
|
||||
with open('README.md', 'w') as f:
|
||||
f.write(markdown+'计数: '+str(len(lines))+' 篇。\n\n')
|
||||
f.write('\n'.join(header))
|
||||
f.write('\n'.join(set(lines)))
|
2
metadata.md
Normal file
2
metadata.md
Normal file
@ -0,0 +1,2 @@
|
||||
| Article | Blog\_ID | IA\_Archived |
|
||||
| --- | --- | --- |
|
Loading…
Reference in New Issue
Block a user