diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100755 index 0000000..5666c78 --- /dev/null +++ b/.github/workflows/main.yml @@ -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 }} diff --git a/main.py b/main.py new file mode 100644 index 0000000..b6993e9 --- /dev/null +++ b/main.py @@ -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))) \ No newline at end of file diff --git a/metadata.md b/metadata.md new file mode 100644 index 0000000..7bb55aa --- /dev/null +++ b/metadata.md @@ -0,0 +1,2 @@ +| Article | Blog\_ID | IA\_Archived | +| --- | --- | --- |